Improve pantry view
This commit is contained in:
@@ -248,9 +248,10 @@ export function addOrMergeShoppingLines(lines, listId = KITCHEN_LIST_ID) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Jedna sztuka / domyślna jednostka magazynowa — na listę kuchenną ze spiżarni.
|
||||
* Na listę kuchenną ze spiżarni (amount w pantryUnit: g, ml lub szt.).
|
||||
* @param {string} [sourceNote] — nadpisuje domyślne „Ze spiżarni”
|
||||
*/
|
||||
export function addIngredientToKitchenList(ingredientId, amount = 1) {
|
||||
export function addIngredientToKitchenList(ingredientId, amount = 1, sourceNote) {
|
||||
const def = INGREDIENTS[ingredientId];
|
||||
if (!def) return;
|
||||
const unit = displayUnit(def.pantryUnit);
|
||||
@@ -260,7 +261,7 @@ export function addIngredientToKitchenList(ingredientId, amount = 1) {
|
||||
unit,
|
||||
name: def.name,
|
||||
category: def.category,
|
||||
sourceNote: 'Ze spiżarni',
|
||||
sourceNote: sourceNote ?? 'Ze spiżarni',
|
||||
}], KITCHEN_LIST_ID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user