This reverts commit 6ee5de3477, reversing
changes made to d7491e8637.
This commit is contained in:
Georg Reisinger
2018-10-29 08:59:29 +01:00
parent 6ee5de3477
commit 84afb3f32d
3 changed files with 3 additions and 70 deletions

View File

@ -49,7 +49,6 @@ router.get('/logout', (req, res) => {
router.get('/dash', function(req, res, next) {
console.log("Session: ", req.session.passport.user.token);
console.log("User ID: " + req.session.passport.user.profile.id);
if (req.session.passport.user.token) {
res.render('index');
} else {
@ -62,7 +61,7 @@ router.get('/dash', function(req, res, next) {
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(req.session.passport.user.profile.id));
res.status(200).send(await postgres.getShoppinglistsAdmin("testuser"));
}
catch(err) {
@ -76,7 +75,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(req.session.passport.user.profile.id));
res.status(200).send(await postgres.getShoppinglistsShared("testuser"));
}
catch(err) {
@ -85,16 +84,4 @@ router.get("/sharedshoppinglists", async function(req, res, next) {
});
//POST new shoppinglist
router.post("/shoppinglist", async function(req, res, next) {
try {
res.status(200).send(await postgres.newShoppinglist(req.body.name, req.body.description, req.session.passport.user.profile.id));
}
catch(err) {
res.status(400).send(await err);
}
});
module.exports = router;