From c0420770670dfe28f1e1a358afc40ae505f9fda4 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 25 Jan 2021 18:37:07 +0100 Subject: [PATCH] Create a notification when responding to group membership request --- src/controllers/groups_controller.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/groups_controller.rs b/src/controllers/groups_controller.rs index 5afd4cf..ddbc47a 100644 --- a/src/controllers/groups_controller.rs +++ b/src/controllers/groups_controller.rs @@ -339,7 +339,11 @@ pub fn respond_request(r: &mut HttpRequestHandler) -> RequestResult { groups_helper::respond_request(&group_id, &user_id, accept)?; - // TODO : Create a notification + // Create a notification + notifications_helper::create_group_membership_notification(&user_id, Some(r.user_id_ref()?), &group_id, match accept { + true => NotifEventType::ACCEPTED_GROUP_MEMBERSHIP_REQUEST, + false => NotifEventType::REJECTED_GROUP_MEMBERSHIP_REQUEST + })?; r.success("The response to the request has been successfully saved!") }