Fixed error messages
the build was successful Details

This commit is contained in:
kolaente 2017-11-23 15:28:38 +01:00
parent 7f9e132cf4
commit ae80d91f34
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
9 changed files with 25 additions and 24 deletions

View File

@ -61,7 +61,7 @@
this.loading = false
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}

View File

@ -132,7 +132,7 @@ export default {
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}

View File

@ -64,7 +64,7 @@
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}

View File

@ -78,7 +78,7 @@
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}

View File

@ -148,7 +148,7 @@ export default {
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}
@ -209,6 +209,9 @@ export default {
this.allStatus = response.data
})
.catch(e => {
if (!e.response.data.Message) {
e.response.data = { Message: 'Could not get Status.' }
}
this.errorNotification(e)
})
},

View File

@ -165,7 +165,7 @@
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}

View File

@ -56,7 +56,7 @@
this.loading = false
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}

View File

@ -108,20 +108,6 @@ export default {
'$route': 'loadPublishers'
},
computed: {
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
err += '<br/>' + e.response.data.Message
}
// Fire a notification
this.$notify({
type: 'error',
title: this.langGeneral.error,
text: err
})
},
filteredData: function () {
var filterKey = this.searchQuery && this.searchQuery.toLowerCase()
var data = this.publishers
@ -143,6 +129,20 @@ export default {
}
},
methods: {
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}
// Fire a notification
this.$notify({
type: 'error',
title: this.langGeneral.error,
text: err
})
},
loadPublishers () {
this.loading = true
this.publishers = []
@ -177,10 +177,8 @@ export default {
DeletePublisher (obj) {
this.showModal = true
this.$on('delete-submit', function () {
console.log(obj)
HTTP.delete('publishers/' + obj.ID.content)
.then(response => {
console.log(response)
if (response.status === 200 && response.data.Message === 'success') {
// Fire a notification
this.$notify({

View File

@ -57,7 +57,7 @@
errorNotification (e) {
// Build the notification text from error response
let err = e.message
if (e.response.data) {
if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message
}