2018-09-08 21:43:16 +02:00
|
|
|
export default {
|
|
|
|
error(e, context) {
|
|
|
|
// Build the notification text from error response
|
|
|
|
let err = e.message
|
|
|
|
if (e.response && e.response.data && e.response.data.message) {
|
|
|
|
err += '<br/>' + e.response.data.message
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fire a notification
|
|
|
|
context.$notify({
|
|
|
|
type: 'error',
|
|
|
|
title: 'Error',
|
|
|
|
text: err
|
|
|
|
})
|
2018-09-09 21:28:07 +02:00
|
|
|
},
|
|
|
|
success(e, context) {
|
|
|
|
// Build the notification text from error response
|
|
|
|
let err = e.message
|
|
|
|
if (e.response && e.response.data && e.response.data.message) {
|
|
|
|
err += '<br/>' + e.response.data.message
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fire a notification
|
|
|
|
context.$notify({
|
|
|
|
type: 'success',
|
|
|
|
title: 'Success',
|
|
|
|
text: err
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2018-09-08 21:43:16 +02:00
|
|
|
}
|