delete function

This commit is contained in:
Lukas Nowy
2018-11-19 21:05:06 +01:00
parent 6cef184f2b
commit 04c0d69cb3
4 changed files with 99 additions and 23 deletions

View File

@ -110,6 +110,18 @@ router.get("/shoppinglist/:sl_id", async (req, res) => {
}
});
//DELETE Shoppinglist
router.delete("/shoppinglist", async (req, res) => {
try {
res.status(200).send(await postgres.deleteShoppinglist(req.body.sl_id));
}
catch(err) {
res.status(400).send(await err);
}
});
router.get("/test1", (req, res) => {
res.render("index1");
});