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

@@ -41,6 +41,32 @@ postDB = (DB)=>{
});
}
DB.bookmarkPost = async (postid, profileId)=>{
const _id = DB.ObjectID(postid);
let update = {
$addToSet:{
bookmarks: DB.ObjectID(profileId)
}
}
return DB.postCols.updateOne({_id}, update).catch((err)=>{
console.log(err);
return false;
});
}
DB.unbookmarkPost = async (postid, profileId)=>{
const _id = DB.ObjectID(postid);
let update = {
$pull:{
bookmarks: DB.ObjectID(profileId)
}
}
return DB.postCols.updateOne({_id}, update).catch((err)=>{
console.log(err);
return false;
});
}
DB.newComment = (postid, comment) => {
const id = DB.ObjectID(postid);
return DB.postCols.updateOne({_id: id}, {