mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
update product normalization
This commit is contained in:
@@ -35,7 +35,12 @@ export const handler: SWRHook<
|
||||
variables: { category: categoryId, search },
|
||||
})
|
||||
|
||||
const products = results.map((product) => normalizeProduct(product))
|
||||
const products = results.map((product) => {
|
||||
if (product.variants) {
|
||||
product.variants = product.variants?.results
|
||||
}
|
||||
return normalizeProduct(product)
|
||||
})
|
||||
|
||||
return {
|
||||
products,
|
||||
|
Reference in New Issue
Block a user