web/admin: fix error when creating new users
Signed-off-by: Jens Langhammer <jens@goauthentik.io> #4685
This commit is contained in:
parent
7d6b573f8b
commit
dfb9ae548c
|
@ -51,7 +51,7 @@ export class GroupForm extends ModelForm<Group, string> {
|
||||||
patchedGroupRequest: data,
|
patchedGroupRequest: data,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
data.users = Array.from(this.instance?.users || []);
|
data.users = [];
|
||||||
return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({
|
return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({
|
||||||
groupRequest: data,
|
groupRequest: data,
|
||||||
});
|
});
|
||||||
|
|
|
@ -48,6 +48,7 @@ export class UserForm extends ModelForm<User, number> {
|
||||||
patchedUserRequest: data,
|
patchedUserRequest: data,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
data.groups = [];
|
||||||
return new CoreApi(DEFAULT_CONFIG).coreUsersCreate({
|
return new CoreApi(DEFAULT_CONFIG).coreUsersCreate({
|
||||||
userRequest: data,
|
userRequest: data,
|
||||||
});
|
});
|
||||||
|
|
Reference in New Issue