feat(shopping): setCartServings mit Positiv-Validation
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 2m15s
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 2m15s
This commit is contained in:
@@ -55,11 +55,16 @@ export function removeRecipeFromCart(
|
||||
}
|
||||
|
||||
export function setCartServings(
|
||||
_db: Database.Database,
|
||||
_recipeId: number,
|
||||
_servings: number
|
||||
db: Database.Database,
|
||||
recipeId: number,
|
||||
servings: number
|
||||
): void {
|
||||
throw new Error('not implemented');
|
||||
if (!Number.isInteger(servings) || servings <= 0) {
|
||||
throw new Error(`Invalid servings: ${servings}`);
|
||||
}
|
||||
db.prepare(
|
||||
'UPDATE shopping_cart_recipe SET servings = ? WHERE recipe_id = ?'
|
||||
).run(servings, recipeId);
|
||||
}
|
||||
|
||||
export function listShoppingList(db: Database.Database): ShoppingListSnapshot {
|
||||
|
||||
Reference in New Issue
Block a user