4
0
forked from crowetic/commerce
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 {}

View File

@ -57,7 +57,7 @@
"lodash.debounce": "^4.0.8",
"lodash.random": "^3.2.0",
"lodash.throttle": "^4.1.1",
"next": "^10.0.5-canary.11",
"next": "^10.0.5",
"next-seo": "^4.11.0",
"next-themes": "^0.0.4",
"postcss-nesting": "^7.0.1",

7
pages/index2.tsx Normal file
View File

@ -0,0 +1,7 @@
import { Layout } from '@components/common'
export default function Home() {
return <>Hello</>
}
Home.Layout = Layout

View File

@ -5038,7 +5038,7 @@ next-unused@^0.0.3:
madge "^3.8.0"
ts-loader "^7.0.0"
next@^10.0.5-canary.11:
next@^10.0.5:
version "10.0.5"
resolved "https://registry.yarnpkg.com/next/-/next-10.0.5.tgz#8071e0aa1883266c91943aa7c6b73deadb064793"
integrity sha512-yr7ap2TLugf0aMHz+3JoKFP9CCkFE+k6jCfdUymORhptjLYZbD3YGlTcUC1CRl+b5Phlbl7m/WUIPde0VcguiA==