Reorganise adding recipe to plan
Some checks failed
Build and Deploy / build-and-push (push) Failing after 21s

This commit is contained in:
2026-03-27 15:20:46 +01:00
parent a22bb7b35c
commit 5c17976732
5 changed files with 551 additions and 292 deletions

View File

@@ -28,6 +28,9 @@ export function normalizeSlotValue(v) {
id: x.id && String(x.id).length ? String(x.id) : newPlanEntryId(),
recipeId: x.recipeId,
servings: Math.max(1, Math.min(12, Number(x.servings) || 1)),
...(x.substitutions && typeof x.substitutions === 'object' && !Array.isArray(x.substitutions) && Object.keys(x.substitutions).length > 0
? { substitutions: { ...x.substitutions } }
: {}),
}));
}
if (typeof v === 'object' && v.recipeId && RECIPES[v.recipeId]) {
@@ -35,6 +38,9 @@ export function normalizeSlotValue(v) {
id: newPlanEntryId(),
recipeId: v.recipeId,
servings: Math.max(1, Math.min(12, Number(v.servings) || 1)),
...(v.substitutions && typeof v.substitutions === 'object' && !Array.isArray(v.substitutions) && Object.keys(v.substitutions).length > 0
? { substitutions: { ...v.substitutions } }
: {}),
}];
}
return [];