From 7f51a020765718e607fe44a634e0bd4855c99837 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 23 May 2024 11:17:33 -0700 Subject: fix: Reset notification email automatically when deleting additonal email Signed-off-by: Christopher Ng --- apps/provisioning_api/lib/Controller/UsersController.php | 3 +++ apps/settings/src/components/PersonalInfo/EmailSection/Email.vue | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 46773f2f6a5..b0ddd4329af 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -838,6 +838,9 @@ class UsersController extends AUserData { } } $this->accountManager->updateAccount($userAccount); + if ($value === '' && $key === $targetUser->getPrimaryEMailAddress()) { + $targetUser->setPrimaryEMailAddress(''); + } break; case IAccountManager::COLLECTION_EMAIL . self::SCOPE_SUFFIX: diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue index ecc463c7363..ad9835baed1 100644 --- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue +++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue @@ -356,6 +356,9 @@ export default { handleDeleteAdditionalEmail(status) { if (status === 'ok') { this.$emit('delete-additional-email') + if (this.isNotificationEmail) { + this.$emit('update:notification-email', '') + } } else { this.handleResponse({ errorMessage: t('settings', 'Unable to delete additional email address'), -- cgit v1.2.3