Skip to content

Commit

Permalink
Update generate static params
Browse files Browse the repository at this point in the history
  • Loading branch information
goncy committed Aug 30, 2024
1 parent 21f65da commit 8434050
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/[[...product]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import StoreScreen from "@/modules/store/screens/Store";
export async function generateStaticParams() {
const products = await api.list();

return products.map((product) => ({product: [product.id]}));
// Build index for the home page and then for each product
return [{}].concat(products.map((product) => ({product: [product.id]}))) as Record<
string,
string[]
>[];
}

export async function generateMetadata({
Expand Down

0 comments on commit 8434050

Please sign in to comment.