diff --git a/frontend/app/recipes/[id]/edit/page.tsx b/frontend/app/recipes/[id]/edit/page.tsx index 226482ed..d4f6c466 100644 --- a/frontend/app/recipes/[id]/edit/page.tsx +++ b/frontend/app/recipes/[id]/edit/page.tsx @@ -86,7 +86,7 @@ export default function EditRecipePage() { // Konvertera quantity till number för varje ingrediens const recipeToSend = { ...recipe, - ingredients: recipe.ingredients.map((ing) => ({ + ingredients: recipe.ingredients.map(({ location: _loc, ...ing }) => ({ ...ing, quantity: Number(ing.quantity), })), diff --git a/frontend/app/recipes/create/CreateRecipePage.tsx b/frontend/app/recipes/create/CreateRecipePage.tsx index 9d25fedb..9d767e9f 100644 --- a/frontend/app/recipes/create/CreateRecipePage.tsx +++ b/frontend/app/recipes/create/CreateRecipePage.tsx @@ -51,7 +51,7 @@ export default function CreateRecipePage() { // Konvertera quantity till number för varje ingrediens const recipeToSend = { ...recipe, - ingredients: recipe.ingredients.map((ing) => ({ + ingredients: recipe.ingredients.map(({ location: _loc, ...ing }) => ({ ...ing, quantity: Number(ing.quantity), })),