mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 10:18:48 +00:00
Can filter posts via hardcoded topics
This commit is contained in:
parent
1a2f269466
commit
4d4b085a2b
@ -81,21 +81,21 @@ exports.getFollowedPosts = (req, res) => {
|
||||
let posts = [];
|
||||
allPosts.forEach(function(doc) {
|
||||
if(followers_str.includes(doc.data().userHandle)) {
|
||||
if(doc.data().microBlogTopics.includes("purdue") || doc.data().microBlogTopics.includes("2077")) {
|
||||
posts.push(doc.data());
|
||||
}
|
||||
}
|
||||
});
|
||||
/*posts.sort(function(a, b) {
|
||||
return b.createdAt - a.createdAt;
|
||||
});*/
|
||||
return res.status(200).json(posts);
|
||||
})
|
||||
/*.then(function() {
|
||||
res.status(200).send("Successfully retrieved all posts from followed users.");
|
||||
return;
|
||||
})*/
|
||||
.catch(function(err) {
|
||||
res.status(500).send("Failed to retrieve posts.", err);
|
||||
});
|
||||
})
|
||||
.then(function() {
|
||||
//res.status(200).send("Successfully added all follower handles to array.");
|
||||
//res.status(200).send("Successfully retrieved all posts from followed users.");
|
||||
return;
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user