forked from crowetic/commerce
Merge branch 'master' of github.com:okbel/e-comm-example
This commit is contained in:
commit
307c0067cd
@ -37,10 +37,11 @@ export async function getStaticPaths() {
|
|||||||
const { products } = await getAllProductPaths()
|
const { products } = await getAllProductPaths()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// paths: products.map((product) => ({
|
paths: products.map((product) => {
|
||||||
// params: { slug: product!.node.path.trim() },
|
const { path } = product!.node
|
||||||
// })),
|
// Exclude the slashes: `/slug/` -> `slug`
|
||||||
paths: [],
|
return { params: { slug: path.substring(1, path.length - 1) } }
|
||||||
|
}),
|
||||||
fallback: 'unstable_blocking',
|
fallback: 'unstable_blocking',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user