mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Iterations and TS error fixes
This commit is contained in:
@@ -7,7 +7,6 @@ interface CategoryPageProps {
|
||||
// has access to state and effects just like Page components
|
||||
// in the `pages` directory.
|
||||
export default function ProductPage({data }: CategoryPageProps) {
|
||||
console.log(data);
|
||||
|
||||
return (
|
||||
<>Category page</>
|
||||
|
@@ -14,8 +14,6 @@ export async function generateStaticParams() {
|
||||
next: { revalidate: 10 },
|
||||
})
|
||||
|
||||
// console.log(paths)
|
||||
|
||||
return paths.map((path: {
|
||||
slug: string,
|
||||
locale: string
|
||||
@@ -52,7 +50,7 @@ export default async function Page({
|
||||
}) {
|
||||
const { slug, locale } = params;
|
||||
|
||||
const { query, queryParams, docType } = getQueryFromSlug(slug, locale)
|
||||
const { query = '', queryParams, docType } = getQueryFromSlug(slug, locale)
|
||||
|
||||
const pageData = await client.fetch(query, queryParams)
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import ProductView from "components/product/product-view";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
interface ProductPageProps {
|
||||
data: object | any
|
||||
@@ -8,6 +9,10 @@ interface ProductPageProps {
|
||||
// has access to state and effects just like Page components
|
||||
// in the `pages` directory.
|
||||
export default function ProductPage({data }: ProductPageProps) {
|
||||
if (!data) {
|
||||
return notFound();
|
||||
}
|
||||
|
||||
const { product } = data;
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user