feed with followers only

This commit is contained in:
Adolfo Reyna
2021-09-02 12:02:09 -07:00
parent fa0d6ee199
commit 9a302a87de
4 changed files with 70 additions and 2 deletions

View File

@@ -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