4
0
forked from crowetic/commerce

Merge branch 'master' of github.com:okbel/e-comm-example

This commit is contained in:
Belen Curcio 2020-10-02 14:59:51 -03:00
commit 307c0067cd

View File

@ -37,10 +37,11 @@ export async function getStaticPaths() {
const { products } = await getAllProductPaths()
return {
// paths: products.map((product) => ({
// params: { slug: product!.node.path.trim() },
// })),
paths: [],
paths: products.map((product) => {
const { path } = product!.node
// Exclude the slashes: `/slug/` -> `slug`
return { params: { slug: path.substring(1, path.length - 1) } }
}),
fallback: 'unstable_blocking',
}
}