mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 21:51: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) => ({
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user