mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 05:54:34 +02:00
Move locales to single json files & Replace laravel-vue-i18n with vue-i18n
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import appSettingService from '@/services/appSettingService'
|
||||
import { useNotifyStore } from '@/stores/notify'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
/**
|
||||
* Saves a setting on the backend
|
||||
@ -8,13 +9,15 @@ import { useNotifyStore } from '@/stores/notify'
|
||||
*/
|
||||
export async function useAppSettingsUpdater(setting, value, returnValidationError = false) {
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
let data = null
|
||||
let error = null
|
||||
|
||||
await appSettingService.update(setting, value, { returnError: true })
|
||||
.then(response => {
|
||||
data = value
|
||||
useNotifyStore().success({ type: 'is-success', text: trans('settings.forms.setting_saved') })
|
||||
useNotifyStore().success({ type: 'is-success', text: t('message.settings.forms.setting_saved') })
|
||||
})
|
||||
.catch(err => {
|
||||
if( returnValidationError && err.response.status === 422 ) {
|
||||
|
Reference in New Issue
Block a user