[Toast] Added error parsing global function

This commit is contained in:
Matej Glasnák committed 2023-11-08 17:40:30 +01:00
1 parent 24a47e4859
commit 8ae34e2829
2 files changed
+2 -1

No files matched your search

@@ -49,7 +49,7 @@ export default {
await this.$store.dispatch('auth/login', this.form) await this.$store.dispatch('auth/login', this.form)
this.$router.push({ name: 'Dashboard - Tasks'}) this.$router.push({ name: 'Dashboard - Tasks'})
} catch (error) { } catch (error) {
this.$toast.error(error?.response?.data?.message || error) this.$toast.error(this.$parseError(error))
} }
} }
} }
+1
View File
@@ -10,5 +10,6 @@ export default {
app.use(VueToast) app.use(VueToast)
// app.config.globalProperties.$wToast = new Toast() // app.config.globalProperties.$wToast = new Toast()
app.config.globalProperties.$parseError = (error) => error?.data?.message || error?.response?.data?.message || error?.message || error
} }
} }