From 620f7c38c4218bd26515d6e80a0264cba816bf84 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 28 Mar 2020 14:41:35 +0100 Subject: [PATCH] Send a notification when a user requests to join a group --- src/controllers/GroupsController.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/GroupsController.ts b/src/controllers/GroupsController.ts index 0d4704d..ad8e0a4 100644 --- a/src/controllers/GroupsController.ts +++ b/src/controllers/GroupsController.ts @@ -369,9 +369,11 @@ export class GroupsController { await GroupsHelper.InsertMember(member); - if(group.registrationLevel == GroupRegistrationLevel.MODERATED_REGISTRATION) { - //TODO : Send a notification - } + if(group.registrationLevel == GroupRegistrationLevel.MODERATED_REGISTRATION) + // Send a notification + await NotificationsHelper.CreateGroupMembershipNotification( + h.getUserId(), 0, groupID, NotifEventType.SENT_GROUP_MEMBERSHIP_REQUEST) + h.success("The membership has been successfully saved!"); }