default to local if no env available

This commit is contained in:
Bel Curcio
2021-06-14 15:10:25 -03:00
parent d84dc0bad6
commit cbcc53e342
5 changed files with 16 additions and 18 deletions

View File

@@ -52,12 +52,12 @@ export async function getStaticPaths({ locales }: GetStaticPathsContext) {
paths: locales
? locales.reduce<string[]>((arr, locale) => {
// Add a product path for every locale
products.forEach((product) => {
products.forEach((product: any) => {
arr.push(`/${locale}/product${product.path}`)
})
return arr
}, [])
: products.map((product) => `/product${product.path}`),
: products.map((product: any) => `/product${product.path}`),
fallback: 'blocking',
}
}