einkaufslisten übersicht, detailansicht
This commit is contained in:
		@@ -63,7 +63,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("testuser"));
 | 
			
		||||
    res.status(200).send(await postgres.getShoppinglistsAdmin("testuser1"));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  catch(err) {
 | 
			
		||||
@@ -77,7 +77,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("testuser"));
 | 
			
		||||
    res.status(200).send(await postgres.getShoppinglistsShared("testuser1"));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  catch(err) {
 | 
			
		||||
@@ -90,7 +90,19 @@ 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, "testuser"));
 | 
			
		||||
    res.status(200).send(await postgres.newShoppinglist(req.body.name, req.body.description, "testuser1"));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  catch(err) {
 | 
			
		||||
    res.status(400).send(await err);
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
//GET Shoppinglist detail
 | 
			
		||||
 | 
			
		||||
router.get("/shoppinglist/:sl_id", async (req, res) => {
 | 
			
		||||
  try {
 | 
			
		||||
    res.status(200).send(await postgres.displayShoppinglist(req.params.sl_id));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  catch(err) {
 | 
			
		||||
@@ -99,7 +111,7 @@ router.post("/shoppinglist", async function(req, res, next) {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
router.get("/test1", (req, res) => {
 | 
			
		||||
  res.send(req.user);
 | 
			
		||||
  res.render("index1");
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
module.exports = router;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user