This commit is contained in:
Belen Curcio
2021-01-11 13:25:25 -03:00
parent a3a2c15f70
commit 28b244760a
5 changed files with 13 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ async function getAllProducts({
variables?: ProductVariables
config?: BigcommerceConfig
preview?: boolean
} = {}): Promise<{ products: Product[] }> {
} = {}): Promise<{ products: Product[] | any[] }> {
config = getConfig(config)
const locale = vars.locale || config.locale
@@ -127,7 +127,7 @@ async function getAllProducts({
})
}
return { products: products.map(normalizeProduct) }
return { products }
}
export default getAllProducts

View File

@@ -93,7 +93,7 @@ async function getProduct({
variables: ProductVariables
config?: BigcommerceConfig
preview?: boolean
}): Promise<Product | {}> {
}): Promise<Product | {} | any> {
config = getConfig(config)
const locale = vars.locale || config.locale
@@ -111,7 +111,7 @@ async function getProduct({
setProductLocaleMeta(product)
}
return { product: normalizeProduct(product) }
return { product }
}
return {}