Replace the notify store with 2fauth/ui notifier & 2fauth/stores parser

This commit is contained in:
Bubka
2025-06-23 14:53:17 +02:00
parent 6f419cfbcb
commit 16a1a9077d
39 changed files with 192 additions and 203 deletions

View File

@ -1,6 +1,7 @@
import appSettingService from '@/services/appSettingService'
import { useNotifyStore } from '@/stores/notify'
import { useI18n } from 'vue-i18n'
import { useErrorHandler } from '@2fauth/stores'
import { useNotify } from '@2fauth/ui'
/**
* Saves a setting on the backend
@ -17,14 +18,15 @@ export async function useAppSettingsUpdater(setting, value, returnValidationErro
await appSettingService.update(setting, value, { returnError: true })
.then(response => {
data = value
useNotifyStore().success({ type: 'is-success', text: t('message.settings.forms.setting_saved') })
useNotify().success({ text: t('message.settings.forms.setting_saved') })
})
.catch(err => {
if( returnValidationError && err.response.status === 422 ) {
error = err
}
else {
useNotifyStore().error(err);
useErrorHandler().parse(err)
router.push({ name: 'genericError' })
}
})