mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-03 22:01:45 +01:00
1 line
1.6 KiB
Plaintext
1 line
1.6 KiB
Plaintext
{"version":3,"file":"appSettingsUpdater-CwAA4o0u.js","sources":["../../../resources/js/composables/appSettingsUpdater.js"],"sourcesContent":["import appSettingService from '@/services/appSettingService'\nimport { useAppSettingsStore } from '@/stores/appSettings'\nimport { useNotifyStore } from '@/stores/notify'\n\n/**\n * Saves a setting on the backend\n * @param {string} preference \n * @param {any} value \n */\nexport async function useAppSettingsUpdater(setting, value, returnValidationError = false) {\n\n // const appSettings = useAppSettingsStore()\n let data = null\n let error = null\n\n await appSettingService.update(setting, value, { returnError: true })\n .then(response => {\n // appSettings[setting] = value\n data = value\n useNotifyStore().success({ type: 'is-success', text: trans('settings.forms.setting_saved') })\n })\n .catch(err => {\n if( returnValidationError && err.response.status === 422 ) {\n error = err\n }\n else {\n useNotifyStore().error(err);\n }\n })\n\n return { data, error }\n}"],"names":["useAppSettingsUpdater","setting","value","returnValidationError","data","error","appSettingService","response","useNotifyStore","trans","err"],"mappings":"wIASO,eAAeA,EAAsBC,EAASC,EAAOC,EAAwB,GAAO,CAGvF,IAAIC,EAAO,KACPC,EAAQ,KAEZ,aAAMC,EAAkB,OAAOL,EAASC,EAAO,CAAE,YAAa,EAAM,CAAA,EACnE,KAAKK,GAAY,CAEdH,EAAOF,EACPM,EAAgB,EAAC,QAAQ,CAAE,KAAM,aAAc,KAAMC,EAAM,8BAA8B,CAAG,CAAA,CAC/F,CAAA,EACA,MAAMC,GAAO,CACNP,GAAyBO,EAAI,SAAS,SAAW,IACjDL,EAAQK,EAGRF,EAAgB,EAAC,MAAME,CAAG,CAEjC,CAAA,EAEM,CAAE,KAAAN,EAAM,MAAAC,CAAK,CACxB"} |