mirror of
https://github.com/vercel/commerce.git
synced 2025-06-20 06:01:21 +00:00
fix/saleor: display the custom categories
This commit is contained in:
parent
4492f3051c
commit
2c8673c15a
@ -10,14 +10,18 @@ const getCategories = async (config: SaleorConfig): Promise<Category[]> => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
const categories =
|
||||||
data.collections?.edges?.map(({ node: { id, name, slug } }: CollectionCountableEdge) => ({
|
data.collections?.edges?.map(({ node: { id, name, slug } }: CollectionCountableEdge) => ({
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
slug,
|
slug,
|
||||||
path: `/${slug}`,
|
path: `/${slug}`,
|
||||||
})) ?? []
|
})) ?? []
|
||||||
)
|
|
||||||
|
// FIXME temp hack
|
||||||
|
const result = categories.sort((a: any, b: any) => a.name.localeCompare(b.name))
|
||||||
|
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export default getCategories
|
export default getCategories
|
||||||
|
Loading…
x
Reference in New Issue
Block a user