bookmarks in progress missing notifications

This commit is contained in:
Adolfo Reyna
2021-09-14 23:00:23 -07:00
parent 0907c1c1b5
commit 55c0c10a35
4 changed files with 53 additions and 5 deletions

View File

@@ -44,23 +44,40 @@ DB.getDB.then((DB)=>{
});
router.post("/react", async (req, res) => {
let userid = getProfileId(req);
let profileid = getProfileId(req);
let postid = req.body.postid;
let reaction = {
type: "like",
createdAt: new Date()
};
r = await DB.newReaction(postid, userid, reaction);
r = await DB.newReaction(postid, profileid, reaction);
return res.json({
status: "ok"
});
})
router.post("/unreact", async (req, res) => {
let userid = getProfileId(req);
let profileid = getProfileId(req);
let postid = req.body.postid;
r = await DB.removeReaction(postid, userid);
console.log(r)
r = await DB.removeReaction(postid, profileid);
return res.json({
status: "ok"
})
});
router.post("/bookmark", async (req, res) => {
let profileid = getProfileId(req);
let postid = req.body.postid;
r = await DB.bookmarkPost(postid, profileid);
return res.json({
status: "ok"
});
})
router.post("/unbookmark", async (req, res) => {
let profileid = getProfileId(req);
let postid = req.body.postid;
r = await DB.unbookmarkPost(postid, profileid);
return res.json({
status: "ok"
})