swipe, zoeken op producten, beter toevoegen in lijsten

This commit is contained in:
2026-09-06 20:44:04 +02:00
parent ce07575d5e
commit a4d61ca26c
13 changed files with 437 additions and 157 deletions
+16
View File
@@ -56,6 +56,22 @@ class ShoppingListRepository {
`).run(listId, productId, amount, nextSortOrder);
}
hasProduct(listId, productId) {
return db.prepare(`
SELECT 1 FROM shopping_list_items
WHERE list_id = ? AND product_id = ?
LIMIT 1
`).get(listId, productId) !== undefined;
}
updateItemAmount(listId, itemId, amount) {
return db.prepare(`
UPDATE shopping_list_items
SET amount = ?
WHERE id = ? AND list_id = ?
`).run(amount, itemId, listId);
}
toggleItem(listId, itemId) {
return db.prepare(`
UPDATE shopping_list_items