mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 10:18:48 +00:00
Fixed having multiple return statements in post.js
This commit is contained in:
parent
cff0fd4e05
commit
7c7256acbd
@ -40,12 +40,11 @@ exports.getallPostsforUser = (req, res) => {
|
||||
});
|
||||
return res.status(200).json(posts);
|
||||
})
|
||||
.then(function() {
|
||||
return res.status(200).json("Successfully retrieved all user's posts from database.");
|
||||
|
||||
})
|
||||
// .then(function() {
|
||||
// return res.status(200).json("Successfully retrieved all user's posts from database.");
|
||||
// })
|
||||
.catch(function(err) {
|
||||
return res.status(500).json("Failed to retrieve user's posts from database.", err);
|
||||
return res.status(500).json(`Failed to retrieve user's posts from database.\n${err}`);
|
||||
});
|
||||
};
|
||||
|
||||
@ -59,11 +58,11 @@ exports.getallPosts = (req, res) => {
|
||||
});
|
||||
return res.status(200).json(posts);
|
||||
})
|
||||
.then(function() {
|
||||
return res.status(200).json("Successfully retrieved every post from database.");
|
||||
})
|
||||
// .then(function() {
|
||||
// return res.status(200).json("Successfully retrieved every post from database.");
|
||||
// })
|
||||
.catch(function(err) {
|
||||
return res.status(500).json("Failed to retrieve posts from database.", err);
|
||||
return res.status(500).json(`Failed to retrieve posts from database.\n ${err}`);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user