Improved Categories (#339)

* Improved Categories

* Improved Categories

* Improved Categories

* Improved Categories

* Improved Categories

* Improved Categories
This commit is contained in:
B
2021-05-31 19:44:08 -03:00
committed by GitHub
parent 84a72718d2
commit 1bc721de83
19 changed files with 94 additions and 88 deletions

View File

@@ -11,6 +11,7 @@ import { getConfig } from '@framework/api'
import getProduct from '@framework/product/get-product'
import getAllPages from '@framework/common/get-all-pages'
import getAllProductPaths from '@framework/product/get-all-product-paths'
import getSiteInfo from '@framework/common/get-site-info'
export async function getStaticProps({
params,
@@ -24,6 +25,7 @@ export async function getStaticProps({
config,
preview,
})
const { categories } = await getSiteInfo({ config, preview })
if (!product) {
throw new Error(`Product with slug '${params!.slug}' not found`)
@@ -33,6 +35,7 @@ export async function getStaticProps({
props: {
pages,
product,
categories,
},
revalidate: 200,
}