From 82b1e039e65662235a5b24855bb8734512567857 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:06:32 +0200 Subject: [PATCH] Fix appSettings not being saved to db in Options view --- resources/js_vue3/views/settings/Options.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/resources/js_vue3/views/settings/Options.vue b/resources/js_vue3/views/settings/Options.vue index ed635099..4c3cd6ff 100644 --- a/resources/js_vue3/views/settings/Options.vue +++ b/resources/js_vue3/views/settings/Options.vue @@ -2,6 +2,7 @@ import SettingTabs from '@/layouts/SettingTabs.vue' import groupService from '@/services/groupService' import userPreferenceService from '@/services/userPreferenceService' + import appSettingService from '@/services/appSettingService' import { useUserStore } from '@/stores/user' import { useAppSettingsStore } from '@/stores/appSettings' import { useNotifyStore } from '@/stores/notify' @@ -82,9 +83,13 @@ }) appSettings.$subscribe((mutation) => { - appSettingService.update(mutation.events.key, mutation.events.newValue).then(response => { - useNotifyStore().info({ type: 'is-success', text: trans('settings.forms.setting_saved') }) - }) + if (mutation.type == 'patch object') { + for (const property in mutation.payload) { + appSettingService.update(property, mutation.payload[property].value).then(response => { + useNotifyStore().info({ type: 'is-success', text: trans('settings.forms.setting_saved') }) + }) + } + } }) onMounted(() => { @@ -105,6 +110,7 @@ notify.clear() } }) +