mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-26 07:19:22 +00:00
Create notification when sending a group membership request
This commit is contained in:
parent
5f70c32b96
commit
3ceb2ae13d
@ -241,13 +241,18 @@ pub fn send_request(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
groups_helper::insert_member(&GroupMember {
|
||||
id: 0,
|
||||
user_id: r.user_id()?,
|
||||
group_id,
|
||||
group_id: group_id.clone(),
|
||||
time_create: time(),
|
||||
level,
|
||||
following: true,
|
||||
})?;
|
||||
|
||||
// TODO : Send a notification, if required
|
||||
// Send a notification, if required
|
||||
if matches!(group.registration_level, GroupRegistrationLevel::MODERATED_REGISTRATION) {
|
||||
notifications_helper::create_group_membership_notification(r.user_id_ref()?, None,
|
||||
&group_id, NotifEventType::SENT_GROUP_MEMBERSHIP_REQUEST)?;
|
||||
}
|
||||
|
||||
|
||||
r.success("The membership has been successfully saved!")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user