refactor(shopping): listShoppingList - Pipe-safe name/family lookup
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 2m14s

Liest nameKey und familyKey direkt von members[0] statt den
Composite-Key am Pipe-Zeichen zu splitten. Verhindert falsche
Dekodierung bei Zutaten wie "Fleisch- | Wurstwaren".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-22 17:05:53 +02:00
parent f2656bd9e3
commit b2337a5c2a

View File

@@ -128,8 +128,9 @@ export function listShoppingList(
}
const rows: ShoppingListRow[] = [];
for (const [key, members] of grouped) {
const [nameKey, familyKey] = key.split('|');
for (const members of grouped.values()) {
const nameKey = members[0].name_key;
const familyKey = unitFamily(members[0].unit_key);
const consolidated = consolidate(
members.map((m) => ({ quantity: m.total_quantity, unit: m.display_unit }))
);