From dfb9ae548ccf2833382aaabf2059a39176824ce7 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 15 Feb 2023 15:32:48 +0100 Subject: [PATCH] web/admin: fix error when creating new users Signed-off-by: Jens Langhammer #4685 --- web/src/admin/groups/GroupForm.ts | 2 +- web/src/admin/users/UserForm.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/admin/groups/GroupForm.ts b/web/src/admin/groups/GroupForm.ts index 5a4024512..9ceb6c6cc 100644 --- a/web/src/admin/groups/GroupForm.ts +++ b/web/src/admin/groups/GroupForm.ts @@ -51,7 +51,7 @@ export class GroupForm extends ModelForm { patchedGroupRequest: data, }); } else { - data.users = Array.from(this.instance?.users || []); + data.users = []; return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({ groupRequest: data, }); diff --git a/web/src/admin/users/UserForm.ts b/web/src/admin/users/UserForm.ts index 7ead930b7..ec657cfa4 100644 --- a/web/src/admin/users/UserForm.ts +++ b/web/src/admin/users/UserForm.ts @@ -48,6 +48,7 @@ export class UserForm extends ModelForm { patchedUserRequest: data, }); } else { + data.groups = []; return new CoreApi(DEFAULT_CONFIG).coreUsersCreate({ userRequest: data, });