user id verwenden, statt testuser1

This commit is contained in:
Lukas Nowy 2018-11-20 21:07:00 +01:00
parent 79a5f17a2c
commit 0ba4a11d23

View File

@ -71,7 +71,7 @@ router.get("/myshoppinglists", async function(req, res, next) {
try {
//Get user id: req.session.passport.user.profile.id
res.status(200).send(await postgres.getShoppinglistsAdmin("testuser1"));
res.status(200).send(await postgres.getShoppinglistsAdmin(req.session.passport.user.profile.id));
}
catch(err) {
@ -85,7 +85,7 @@ router.get("/myshoppinglists", async function(req, res, next) {
router.get("/sharedshoppinglists", async function(req, res, next) {
try {
//Get user id: req.session.passport.user.profile.id
res.status(200).send(await postgres.getShoppinglistsShared("testuser1"));
res.status(200).send(await postgres.getShoppinglistsShared(req.session.passport.user.profile.id));
}
catch(err) {
@ -98,7 +98,7 @@ router.get("/sharedshoppinglists", async function(req, res, next) {
router.post("/shoppinglist", async function(req, res, next) {
try {
res.status(200).send(await postgres.newShoppinglist(req.body.name, req.body.description, "testuser1"));
res.status(200).send(await postgres.newShoppinglist(req.body.name, req.body.description, req.session.passport.user.profile.id));
}
catch(err) {