diff --git a/src/controllers/GroupsController.ts b/src/controllers/GroupsController.ts index 6844d3e..64a7e81 100644 --- a/src/controllers/GroupsController.ts +++ b/src/controllers/GroupsController.ts @@ -485,7 +485,12 @@ export class GroupsController { // Respond to the request await GroupsHelper.RespondRequest(groupID, userID, accept); - // TODO : create a notification + // Delete any previous notifications + await NotificationsHelper.DeleteNotificationsGroupsMembership(userID, groupID); + + // Create a notification + await NotificationsHelper.CreateGroupMembershipNotification(userID, h.getUserId(), groupID, + accept ? NotifEventType.ACCEPTED_GROUP_MEMBERSHIP_REQUEST : NotifEventType.REJECTED_GROUP_MEMBERSHIP_REQUEST) h.success("The response to the request has been successfully saved!"); }