Delete profiles and posts
This commit is contained in:
@@ -12,6 +12,15 @@ userDB = (DB) => {
|
||||
});
|
||||
}
|
||||
|
||||
DB.removeProfile = (profileid) => {
|
||||
const _id = DB.ObjectID(profileid);
|
||||
if (userProfileCache[profileid]) delete userProfileCache[profileid];
|
||||
return DB.profileCols.deleteOne({_id}).catch((err)=>{
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
DB.updateProfile = async (profileid, profileObj) => {
|
||||
let tempProfile = profileObj.toObj();
|
||||
const query = {_id: profileid};
|
||||
|
||||
Reference in New Issue
Block a user