user id verwenden, statt testuser1
This commit is contained in:
		@@ -71,7 +71,7 @@ router.get("/myshoppinglists", async function(req, res, next) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    //Get user id: req.session.passport.user.profile.id
 | 
					    //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) {
 | 
					  catch(err) {
 | 
				
			||||||
@@ -85,7 +85,7 @@ router.get("/myshoppinglists", async function(req, res, next) {
 | 
				
			|||||||
router.get("/sharedshoppinglists", async function(req, res, next) {
 | 
					router.get("/sharedshoppinglists", async function(req, res, next) {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    //Get user id: req.session.passport.user.profile.id
 | 
					    //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) {
 | 
					  catch(err) {
 | 
				
			||||||
@@ -98,7 +98,7 @@ router.get("/sharedshoppinglists", async function(req, res, next) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
router.post("/shoppinglist", async function(req, res, next) {
 | 
					router.post("/shoppinglist", async function(req, res, next) {
 | 
				
			||||||
  try {
 | 
					  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) {
 | 
					  catch(err) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user