diff --git a/assets/js/pages/business_settings.js b/assets/js/pages/business_settings.js index 0108f140..4683b54e 100644 --- a/assets/js/pages/business_settings.js +++ b/assets/js/pages/business_settings.js @@ -53,13 +53,13 @@ App.Pages.BusinessSettings = (function () { } } - function serialize(businessSettings) { + function deserialize(businessSettings) { businessSettings.forEach((businessSetting) => { $('[data-field="' + businessSetting.name + '"]').val(businessSetting.value); }); } - function deserialize() { + function serialize() { const businessSettings = []; $('[data-field]').each((index, field) => { @@ -91,7 +91,7 @@ App.Pages.BusinessSettings = (function () { return; } - const businessSettings = deserialize(); + const businessSettings = serialize(); App.Http.BusinessSettings.save(businessSettings).done(() => { Backend.displayNotification(App.Lang.settings_saved); @@ -131,7 +131,7 @@ App.Pages.BusinessSettings = (function () { function init() { const businessSettings = App.Vars.business_settings; - serialize(businessSettings); + deserialize(businessSettings); let workingPlan = {}; diff --git a/assets/js/pages/general_settings.js b/assets/js/pages/general_settings.js index ea5b3e2a..a5de0b24 100644 --- a/assets/js/pages/general_settings.js +++ b/assets/js/pages/general_settings.js @@ -50,13 +50,13 @@ App.Pages.GeneralSettings = (function () { } } - function serialize(generalSettings) { + function deserialize(generalSettings) { generalSettings.forEach((generalSetting) => { $('[data-field="' + generalSetting.name + '"]').val(generalSetting.value); }); } - function deserialize() { + function serialize() { const generalSettings = []; $('[data-field]').each((index, field) => { @@ -81,7 +81,7 @@ App.Pages.GeneralSettings = (function () { return; } - const generalSettings = deserialize(); + const generalSettings = serialize(); App.Http.GeneralSettings.save(generalSettings).done(() => { Backend.displayNotification(App.Lang.settings_saved); @@ -91,7 +91,7 @@ App.Pages.GeneralSettings = (function () { function init() { const generalSettings = App.Vars.general_settings; - serialize(generalSettings); + deserialize(generalSettings); $saveSettings.on('click', onSaveSettingsClick);