From 2c8673c15a79b152e1598032bd96acb9961a71ec Mon Sep 17 00:00:00 2001 From: Zaiste Date: Thu, 10 Jun 2021 21:40:40 +0200 Subject: [PATCH] fix/saleor: display the custom categories --- framework/saleor/utils/get-categories.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/saleor/utils/get-categories.ts b/framework/saleor/utils/get-categories.ts index 990c0a404..bd8fde997 100644 --- a/framework/saleor/utils/get-categories.ts +++ b/framework/saleor/utils/get-categories.ts @@ -10,14 +10,18 @@ const getCategories = async (config: SaleorConfig): Promise => { }, }) - return ( + const categories = data.collections?.edges?.map(({ node: { id, name, slug } }: CollectionCountableEdge) => ({ id, name, slug, path: `/${slug}`, })) ?? [] - ) + + // FIXME temp hack + const result = categories.sort((a: any, b: any) => a.name.localeCompare(b.name)) + + return result } export default getCategories