From 38d7d18298d2cfd73bf8c3bec873f1716c730387 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Tue, 22 Nov 2022 15:25:19 +0100 Subject: [PATCH] Prevent unnecessary request when saving a user --- changelog/unreleased/bugfix-user-save-without-change | 6 ++++++ packages/web-app-user-management/src/views/Users.vue | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/bugfix-user-save-without-change diff --git a/changelog/unreleased/bugfix-user-save-without-change b/changelog/unreleased/bugfix-user-save-without-change new file mode 100644 index 00000000000..30db416ab63 --- /dev/null +++ b/changelog/unreleased/bugfix-user-save-without-change @@ -0,0 +1,6 @@ +Bugfix: Prevent unnecessary request when saving a user + +We've fixed a bug where changing the role of a user without changing any other data would cause an unnecessary request. + +https://github.com/owncloud/web/issues/8011 +https://github.com/owncloud/web/pull/8013 diff --git a/packages/web-app-user-management/src/views/Users.vue b/packages/web-app-user-management/src/views/Users.vue index e4aacecd38a..e8cd64e251f 100644 --- a/packages/web-app-user-management/src/views/Users.vue +++ b/packages/web-app-user-management/src/views/Users.vue @@ -416,7 +416,11 @@ export default defineComponent({ }, async editUser(editUser) { try { - const actualUser = this.users.find((user) => user.id === editUser.id) + const user = this.users.find((user) => user.id === editUser.id) + const actualUser = { + ...(user && user), + passwordProfile: { password: '' } + } const graphEditUserRawObjectExtractor = (user) => { return omit(user, ['drive', 'role'])