From 89911831cbb7ecc9a81b5913fc6e2f98299fc967 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 6 Jan 2025 08:24:56 +0100 Subject: [PATCH] fix(settings): Fix mail server settings form Signed-off-by: provokateurin [skip ci] --- apps/settings/src/admin.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/apps/settings/src/admin.js b/apps/settings/src/admin.js index 054dd7ced2eac..a1e28a3043c16 100644 --- a/apps/settings/src/admin.js +++ b/apps/settings/src/admin.js @@ -46,11 +46,9 @@ window.addEventListener('DOMContentLoaded', () => { data: $('#mail_general_settings_form').serialize(), success: () => { OC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved')) - }, - error: (xhr) => { - OC.msg.finishedError('#mail_settings_msg', xhr.responseJSON) - }, - }) + }).catch((error) => { + OC.msg.finishedError('#mail_settings_msg', error) + }) } const toggleEmailCredentials = function() { @@ -66,11 +64,9 @@ window.addEventListener('DOMContentLoaded', () => { data: $('#mail_credentials_settings').serialize(), success: () => { OC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved')) - }, - error: (xhr) => { - OC.msg.finishedError('#mail_settings_msg', xhr.responseJSON) - }, - }) + }).catch((error) => { + OC.msg.finishedError('#mail_settings_msg', error) + }) } $('#mail_general_settings_form').change(changeEmailSettings) @@ -91,11 +87,9 @@ window.addEventListener('DOMContentLoaded', () => { type: 'POST', success: () => { OC.msg.finishedSuccess('#sendtestmail_msg', t('settings', 'Email sent')) - }, - error: (xhr) => { - OC.msg.finishedError('#sendtestmail_msg', xhr.responseJSON) - }, - }) + }).catch((error) => { + OC.msg.finishedError('#sendtestmail_msg', error) + }) }) const setupChecks = () => {