bookmarks in progress missing notifications
This commit is contained in:
@@ -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"
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user