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

@@ -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};