Notification when accepted on private groups

This commit is contained in:
aeroreyna
2022-03-27 12:02:00 -07:00
parent f7f4592b36
commit 137d91bcc3
2 changed files with 25 additions and 3 deletions

View File

@@ -137,15 +137,15 @@ DB.getDB.then((DB)=>{
}
const profileAcepted = DB.ObjectID(req.body.profileid);
DB.acceptGroupJoinReq(profileAcepted, groupidBody || groupid);
//Add Notification to accepted user
//Notifications.yourGroupHasARequest(profileAcepted, groupidBody || groupid)
//Send Notification to accepted user
Notifications.yourGroupRequestAccepted(profileAcepted, groupidBody || groupid)
return res.json({
status: "ok"
});
});
router.post("/groups/reject", async (req, res) => {
//This function should be called to accept the join request
//This function should be called to reject 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;