remove console.log

This commit is contained in:
Adolfo Reyna
2021-10-18 22:18:54 -07:00
parent 30f9f59923
commit bf58c55e97
2 changed files with 14 additions and 3 deletions

View File

@@ -95,7 +95,6 @@ DB.getDB.then((DB)=>{
isGroup: true,
... req.body
};
console.log("newGroup", profile)
let profileObj = new Profile(profile);
DB.newProfile(profileObj)
return res.json({
@@ -116,8 +115,14 @@ DB.getDB.then((DB)=>{
//This function should be called to accept the join request
//of an user that attempt to join a private group.
const groupid = getProfileId(req); //It needs to have this profile context
const groupidBody = req.body.groupid ? DB.ObjectID(req.body.groupid) : undefined;
if(groupidBody && groupid != groupidBody && !DB.isOwnerOfGroup(groupid, groupidBody)){
return res.json({
status: "Only group owner can accept new subscribers"
});
}
const profileAcepted = DB.ObjectID(req.body.profileid);
DB.acceptGroupJoinReq(profileAcepted, groupid);
DB.acceptGroupJoinReq(profileAcepted, groupidBody || groupid);
//Add Notification to accepted user
return res.json({
status: "ok"