This commit is contained in:
Pete Matsyburka committed 2024-08-03 09:26:26 +03:00
1 parent 3877dbf83f
commit d0c49ac04c
2 files changed
+27 -1

No files matched your search

+3 -1
View File
@@ -1114,7 +1114,9 @@ export default {
if (response.status === 422 || response.status === 500) {
const data = await response.json()
alert(data.error || 'Value is invalid')
const i18nError = data.error ? this.t(data.error.replace(/\s+/g, '_').toLowerCase()) : ''
alert(i18nError !== data.error ? i18nError : (data.error || this.t('value_is_invalid')))
return Promise.reject(new Error(data.error))
}