From 48b86b6642fdcfe4e8e0ecd98df3085f88cd5fb4 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 2 Jun 2021 19:42:30 +0200 Subject: [PATCH] [fix] User edition: alias and password change --- app/src/views/user/UserEdit.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/views/user/UserEdit.vue b/app/src/views/user/UserEdit.vue index 84eea6bc..74c8bca0 100644 --- a/app/src/views/user/UserEdit.vue +++ b/app/src/views/user/UserEdit.vue @@ -273,13 +273,17 @@ export default { if (!Object.prototype.hasOwnProperty.call(formData, 'mailbox_quota')) { formData.mailbox_quota = '' } + if (Object.prototype.hasOwnProperty.call(formData, 'password')) { + formData['change-password'] = formData.password + } + for (const key of ['mail_aliases', 'mail_forward']) { const dashedKey = key.replace('_', '-') const newKey = key.replace('_', '').replace('es', '') const addDiff = arrayDiff(formData[key], user[dashedKey]) const rmDiff = arrayDiff(user[dashedKey], formData[key]) - if (addDiff.length) data['add_' + newKey] = addDiff - if (rmDiff.length) data['remove_' + newKey] = rmDiff + if (addDiff.length) data['add_' + newKey + '[]'] = addDiff + if (rmDiff.length) data['remove_' + newKey + '[]'] = rmDiff } for (const key in formData) {