Skip to content

Commit

Permalink
Fix list of recipes static pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cdedreuille committed Jul 17, 2024
1 parent e93bd2a commit c3e1ce3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/frontpage/app/recipes/[...name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ interface RecipeDetailsProps {

export async function generateStaticParams() {
const recipes = (await fetchRecipesData()) || [];
return recipes.map((name) => ({
params: { name },
const listOfNames = recipes.map((recipe) => ({
name: [...recipe.split('/')],
}));

return listOfNames;
}

export default async function RecipeDetails({ params }: RecipeDetailsProps) {
Expand Down

0 comments on commit c3e1ce3

Please sign in to comment.