From df9f640caa70f145b9a5cadbd04ee46d37eacc3c Mon Sep 17 00:00:00 2001 From: Thomas Schauer-Koeckeis Date: Mon, 18 Nov 2024 14:49:05 +0100 Subject: [PATCH] Uses same thing as the other configs to update Signed-off-by: Thomas Schauer-Koeckeis --- .../configuration/WelcomeMessage.vue | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/views/administration/configuration/WelcomeMessage.vue b/src/views/administration/configuration/WelcomeMessage.vue index 42d223d3..ba732c2c 100644 --- a/src/views/administration/configuration/WelcomeMessage.vue +++ b/src/views/administration/configuration/WelcomeMessage.vue @@ -91,26 +91,20 @@ export default { editor.style.height = editor.scrollHeight + 'px'; }, saveChanges() { - let url = `${this.$api.BASE_URL}/${this.$api.URL_CONFIG_PROPERTY}`; - axios.post(url, { - groupName: 'general', - propertyName: 'welcome.message.html', - propertyValue: encodeURIComponent( - this.welcomeMessage !== '' ? this.welcomeMessage : ' ', - ), - }); - axios - .post(url, { + this.updateConfigProperties([ + { + groupName: 'general', + propertyName: 'welcome.message.html', + propertyValue: encodeURIComponent( + this.welcomeMessage !== '' ? this.welcomeMessage : ' ', + ), + }, + { groupName: 'general', propertyName: 'welcome.message.enabled', propertyValue: this.isWelcomeMessage, - }) - .then((response) => { - this.$toastr.s(this.$t('admin.configuration_saved')); - }) - .catch((error) => { - this.$toastr.w(this.$t('condition.unsuccessful_action')); - }); + }, + ]); }, }, };