Delete profiles and posts

This commit is contained in:
aeroreyna
2022-02-16 20:33:20 -08:00
parent 294cacf963
commit 117bc5833a
5 changed files with 63 additions and 2 deletions

View File

@@ -11,6 +11,14 @@ postDB = (DB)=>{
});
}
DB.removePost = (postid) => {
const _id = DB.ObjectID(postid);
return DB.postCols.deleteOne({_id}).catch((err)=>{
console.log(err);
return false;
});
}
DB.newReaction = (postid, profileid, reaction) => {
const id = DB.ObjectID(postid);
let update = {
@@ -147,6 +155,7 @@ postDB = (DB)=>{
DB.getFeed = async (profileId) => {
const profile = await DB.getProfile(profileId);
if(!profile) return [];
let ids = profile.following.map((id)=>DB.ObjectID(id));
ids.push(DB.ObjectID(profileId))
query = {