mirror of
https://github.com/vercel/commerce.git
synced 2025-07-03 11:41:21 +00:00
Update site info
This commit is contained in:
parent
9aa4871418
commit
fa9317ec11
@ -25,14 +25,14 @@ export default function getSiteInfoOperation({
|
|||||||
// Get fetch from the config
|
// Get fetch from the config
|
||||||
const { fetch } = commerce.getConfig(config)
|
const { fetch } = commerce.getConfig(config)
|
||||||
|
|
||||||
// Get a single product
|
// Get list of categories
|
||||||
const rawCategories: RawCategory[] = await fetch<{ Items: RawCategory[] }>(
|
const rawCategories: RawCategory[] = await fetch<{ Items: RawCategory[] }>(
|
||||||
'GET',
|
'GET',
|
||||||
`/me/categories`
|
`/me/categories`
|
||||||
).then((response) => response.Items)
|
).then((response) => response.Items)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// Normalize product to commerce schema
|
// Normalize categories
|
||||||
categories: rawCategories.map((category) => ({
|
categories: rawCategories.map((category) => ({
|
||||||
id: category.ID,
|
id: category.ID,
|
||||||
name: category.Name,
|
name: category.Name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user