commit 550794b127380c6cde7d601dff51e9adb060d8a8
parent 2aedff50e89fd6a9aa6d0761eb6b13885a365f4d
Author: Mathijs van Veluw <black.dex@gmail.com>
Date: Thu, 22 Jun 2023 11:57:49 +0200
Merge pull request #3606 from farodin91/add-group-import-on-invite
Add group import on invite
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs
@@ -849,6 +849,7 @@ struct CollectionData {
#[allow(non_snake_case)]
struct InviteData {
Emails: Vec<String>,
+ Groups: Vec<String>,
Type: NumberOrString,
Collections: Option<Vec<CollectionData>>,
AccessAll: Option<bool>,
@@ -928,6 +929,11 @@ async fn send_invite(
new_user.save(&mut conn).await?;
+ for group in data.Groups.iter() {
+ let mut group_entry = GroupUser::new(String::from(group), user.uuid.clone());
+ group_entry.save(&mut conn).await?;
+ }
+
log_event(
EventType::OrganizationUserInvited as i32,
&new_user.uuid,