Iterations and TS error fixes

This commit is contained in:
Henrik Larsson
2023-05-05 10:12:15 +02:00
parent c68f95e454
commit 4bf59a61f6
26 changed files with 111 additions and 621 deletions

View File

@@ -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</>

View File

@@ -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)

View File

@@ -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 (