web/admin: fix error when creating new users

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

#4685
This commit is contained in:
Jens Langhammer 2023-02-15 15:32:48 +01:00
parent 7d6b573f8b
commit dfb9ae548c
No known key found for this signature in database
2 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,7 @@ export class GroupForm extends ModelForm<Group, string> {
patchedGroupRequest: data,
});
} else {
data.users = Array.from(this.instance?.users || []);
data.users = [];
return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({
groupRequest: data,
});

View File

@ -48,6 +48,7 @@ export class UserForm extends ModelForm<User, number> {
patchedUserRequest: data,
});
} else {
data.groups = [];
return new CoreApi(DEFAULT_CONFIG).coreUsersCreate({
userRequest: data,
});