From a0f57ad5ba920fe6f3a6c2b4ef32b20cf62b236f Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sun, 14 Apr 2024 16:12:11 +0300 Subject: [PATCH] sort stats list by name --- pages/cart/publishers/stats.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/cart/publishers/stats.tsx b/pages/cart/publishers/stats.tsx index b6ff171..835c79a 100644 --- a/pages/cart/publishers/stats.tsx +++ b/pages/cart/publishers/stats.tsx @@ -220,6 +220,8 @@ export const getServerSideProps = async (context) => { ...publisher, // Potentially add more computed properties or transformations here if needed })); + allPublishers.sort((a, b) => a.firstName.localeCompare(b.firstName) || a.lastName.localeCompare(b.lastName)); + return { props: {