Update site info

This commit is contained in:
goncy 2021-08-11 10:43:58 -03:00
parent 9aa4871418
commit fa9317ec11

View File

@ -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,