mirror of
https://github.com/vercel/commerce.git
synced 2025-03-15 06:52:32 +00:00
Undo changes
This commit is contained in:
parent
6309713c04
commit
d9ee4086b9
@ -1,5 +1,5 @@
|
||||
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||
import getAllProducts from 'lib/bigcommerce/api/operations/get-all-products'
|
||||
import getAllProducts from '@lib/bigcommerce/api/operations/get-all-products'
|
||||
import { Layout } from '@components/core'
|
||||
import { ProductGrid } from '@components/product'
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||
import { useRouter } from 'next/router'
|
||||
// import getProduct from 'lib/bigcommerce/api/operations/get-product'
|
||||
import getProduct from 'lib/bigcommerce/api/operations/get-product'
|
||||
import { Layout } from '@components/core'
|
||||
import { ProductView } from '@components/product'
|
||||
// import getAllProductPaths from '@lib/bigcommerce/api/operations/get-all-product-paths'
|
||||
import getAllProductPaths from '@lib/bigcommerce/api/operations/get-all-product-paths'
|
||||
|
||||
export async function getStaticProps({
|
||||
params,
|
||||
}: GetStaticPropsContext<{ slug: string }>) {
|
||||
// const { product } = await getProduct({ variables: { slug: params!.slug } })
|
||||
const { product } = await getProduct({ variables: { slug: params!.slug } })
|
||||
const productData = {
|
||||
name: 'T-Shirt',
|
||||
description: `
|
||||
@ -26,7 +26,7 @@ export async function getStaticProps({
|
||||
}
|
||||
return {
|
||||
props: {
|
||||
// product,
|
||||
product,
|
||||
productData,
|
||||
},
|
||||
revalidate: 200,
|
||||
@ -34,11 +34,10 @@ export async function getStaticProps({
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
// const { products } = await getAllProductPaths()
|
||||
const { products } = await getAllProductPaths()
|
||||
|
||||
return {
|
||||
paths: [],
|
||||
// paths: products.map((product) => `/product${product!.node.path}`),
|
||||
paths: products.map((product) => `/product${product!.node.path}`),
|
||||
fallback: 'unstable_blocking',
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user