swipe, zoeken op producten, beter toevoegen in lijsten
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user