Skip to content

Commit

Permalink
Build index correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
goncy committed Sep 4, 2024
1 parent e08c4ad commit 6340492
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/[[...product]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ export const dynamicParams = false;
export async function generateStaticParams() {
const products = await api.list();

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

export async function generateMetadata({
Expand Down

0 comments on commit 6340492

Please sign in to comment.