Multi tenant DB, registratie per huishouden V1.2
This commit is contained in:
@@ -22,18 +22,19 @@ class ShoppingListRepository {
|
||||
`).get(id, householdId);
|
||||
}
|
||||
|
||||
getItems(listId) {
|
||||
getItems(listId, householdId) {
|
||||
return db.prepare(`
|
||||
SELECT shopping_list_items.*, products.name AS product_name,
|
||||
categories.name AS category_name, categories.icon AS category_icon
|
||||
FROM shopping_list_items
|
||||
JOIN products ON products.id = shopping_list_items.product_id
|
||||
LEFT JOIN categories ON categories.id = products.category_id
|
||||
WHERE shopping_list_items.list_id = ?
|
||||
WHERE shopping_list_items.list_id = ?
|
||||
AND products.household_id = ?
|
||||
ORDER BY shopping_list_items.checked ASC,
|
||||
shopping_list_items.sort_order ASC,
|
||||
shopping_list_items.created_at ASC
|
||||
`).all(listId);
|
||||
`).all(listId, householdId);
|
||||
}
|
||||
|
||||
create(householdId, name) {
|
||||
|
||||
Reference in New Issue
Block a user