diff --git a/src/app/(storefront)/products/[handle]/page.tsx b/src/app/(storefront)/products/[handle]/page.tsx index 78796eb..8d53a60 100644 --- a/src/app/(storefront)/products/[handle]/page.tsx +++ b/src/app/(storefront)/products/[handle]/page.tsx @@ -1,4 +1,4 @@ -import { HttpTypes } from '@medusajs/types'; +// import { HttpTypes } from '@medusajs/types'; import { FC } from 'react'; import ProductDetails from './ProductDetails'; @@ -8,27 +8,27 @@ interface ProductPageProps { handle: string; }; } -export async function generateStaticParams() { - // Fetch the list of products - const products: HttpTypes.StoreProduct[] = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/store/products`, { - credentials: 'include', - headers: { - 'Content-Type': 'application/json', - 'x-publishable-api-key': process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY as string, - }, - }) - .then((res) => res.json()) - .then((data) => data.products); +// export async function generateStaticParams() { +// // Fetch the list of products +// const products: HttpTypes.StoreProduct[] = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/store/products`, { +// credentials: 'include', +// headers: { +// 'Content-Type': 'application/json', +// 'x-publishable-api-key': process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY as string, +// }, +// }) +// .then((res) => res.json()) +// .then((data) => data.products); - if (!products) { - return []; - } - // Generate static params based on product handles - const staticParams = products.map((product) => ({ - handle: product.handle, - })); - return staticParams; -} +// if (!products) { +// return []; +// } +// // Generate static params based on product handles +// const staticParams = products.map((product) => ({ +// handle: product.handle, +// })); +// return staticParams; +// } const ProductPage: FC = ({ params }) => { const { handle } = params; // Extract the handle from the params