1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 00:45:18 +00:00

Can create group membership notifications

This commit is contained in:
2021-01-23 15:30:14 +01:00
parent fd5000aef9
commit bb06760437
3 changed files with 71 additions and 3 deletions

View File

@ -16,7 +16,8 @@ use crate::data::group_id::GroupID;
use crate::data::group_member::{GroupMember, GroupMembershipLevel};
use crate::data::http_request_handler::HttpRequestHandler;
use crate::data::new_group::NewGroup;
use crate::helpers::{groups_helper, virtual_directory_helper};
use crate::data::notification::NotifEventType;
use crate::helpers::{groups_helper, notifications_helper, virtual_directory_helper};
use crate::helpers::virtual_directory_helper::VirtualDirType;
use crate::utils::date_utils::time;
@ -186,7 +187,9 @@ pub fn invite_user(r: &mut HttpRequestHandler) -> RequestResult {
groups_helper::send_invitation(&group_id, &user_id)?;
// TODO : send a notification
// Send a notification
notifications_helper::create_group_membership_notification(
&user_id, Some(r.user_id_ref()?), &group_id, NotifEventType::SENT_GROUP_MEMBERSHIP_INVITATION)?;
r.success("The user has been successfully invited to join the group!")
}