feed with followers only
This commit is contained in:
@@ -11,7 +11,8 @@ DB.getDB.then((DB)=>{
|
||||
}
|
||||
|
||||
router.get("/", async (req, res) => {
|
||||
let posts = await DB.getPosts();
|
||||
const profileid = getProfileId(req);
|
||||
let posts = await DB.getFeed(profileid);
|
||||
return res.json(posts)
|
||||
});
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ DB.getDB.then((DB)=>{
|
||||
router.get("/groups/:id/unsubscribe", async (req, res) => {
|
||||
const groupid = req.params.id;
|
||||
const profileid = getProfileId(req);
|
||||
DB.unsubscribeToGroup(profileid, groupid).then(console.log);
|
||||
DB.unsubscribeToGroup(profileid, groupid);
|
||||
return res.json({
|
||||
status: "ok"
|
||||
});
|
||||
@@ -96,6 +96,24 @@ DB.getDB.then((DB)=>{
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/:id/follow", async (req, res) => {
|
||||
let followProfileId = req.params.id;
|
||||
const profileid = getProfileId(req);
|
||||
DB.followProfile(profileid, followProfileId);
|
||||
return res.json({
|
||||
status: "ok"
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/:id/unfollow", async (req, res) => {
|
||||
let followProfileId = req.params.id;
|
||||
const profileid = getProfileId(req);
|
||||
DB.unfollowProfile(profileid, followProfileId);
|
||||
return res.json({
|
||||
status: "ok"
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
module.exports = router
|
||||
Reference in New Issue
Block a user