MCPcopy
hub / github.com/jamstack-cms/jamstack-ecommerce / getStaticPaths

Function getStaticPaths

pages/product/[name].js:73–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73export async function getStaticPaths () {
74 const inventory = await fetchInventory()
75 const paths = inventory.map(item => {
76 return { params: { name: slugify(item.name) }}
77 })
78 return {
79 paths,
80 fallback: false
81 }
82}
83
84export async function getStaticProps ({ params }) {
85 const name = params.name.replace(/-/g," ")

Callers

nothing calls this directly

Calls 2

fetchInventoryFunction · 0.90
slugifyFunction · 0.90

Tested by

no test coverage detected