Moved getAllPages everywhere

This commit is contained in:
Luis Alvarez
2021-05-21 15:06:21 -05:00
parent 066a53d52d
commit 9794d5e626
8 changed files with 24 additions and 25 deletions

View File

@@ -4,12 +4,12 @@ import type {
InferGetStaticPropsType,
} from 'next'
import { useRouter } from 'next/router'
import commerce from '@lib/api/commerce'
import { Layout } from '@components/common'
import { ProductView } from '@components/product'
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'
export async function getStaticProps({
@@ -18,7 +18,7 @@ export async function getStaticProps({
preview,
}: GetStaticPropsContext<{ slug: string }>) {
const config = getConfig({ locale })
const { pages } = await getAllPages({ config, preview })
const { pages } = await commerce.getAllPages({ config, preview })
const { product } = await getProduct({
variables: { slug: params!.slug },
config,