zie vorige message
This commit is contained in:
@@ -54,6 +54,15 @@ class ShoppingListController {
|
||||
res.redirect(`/lists/${list.id}`);
|
||||
}
|
||||
|
||||
resetItems(req, res) {
|
||||
const list = ShoppingListRepository.findById(req.params.id, req.user.household_id);
|
||||
if (!list) return res.status(404).render("errors/404");
|
||||
ShoppingListRepository.resetItems(list.id);
|
||||
this.broadcastUpdate(req, list.id);
|
||||
req.flash("success", "Alle producten staan weer open.");
|
||||
res.redirect(`/lists/${list.id}`);
|
||||
}
|
||||
|
||||
deleteItem(req, res) {
|
||||
const list = ShoppingListRepository.findById(req.params.id, req.user.household_id);
|
||||
if (!list) return res.status(404).json({ error: "Lijst niet gevonden" });
|
||||
|
||||
Reference in New Issue
Block a user