Commit 61a8187e authored by vieanh's avatar vieanh

update error alert message

parent fc3c2bc9
......@@ -542,7 +542,7 @@ export default {
.catch((errors) => {
console.log(errors.response.data.message)
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!', {
self.$toast.error(this.message, {
duration: 3000
})
})
......@@ -602,26 +602,27 @@ export default {
if (typeof this.eImage !== 'string' && this.eImage != null) {
fd.append('image', this.eImage)
}
try {
this.$axios
.post(`categories/update/${this?.eID}`, fd, {
headers: {
Authorization: `Bearer ${this.$auth.$storage.getUniversal(
'token'
)}`
}
this.$axios
.post(`categories/update/${this?.eID}`, fd, {
headers: {
Authorization: `Bearer ${this.$auth.$storage.getUniversal(
'token'
)}`
}
})
.then((response) => {
self.$toast.success('Category updated successfully!', {
duration: 3000
})
.then((response) => {
self.$toast.success('Category updated successfully!', {
duration: 3000
})
this.editedItem = response.data.data
Object.assign(this.categories[this.editedIndex], this.editedItem)
this.clearFile()
this.editedItem = response.data.data
Object.assign(this.categories[this.editedIndex], this.editedItem)
this.clearFile()
}).catch((errors) => {
this.message = errors.response.data.message
self.$toast.error(this.message, {
duration: 3000
})
} catch (error) {
console.log(error)
}
})
},
clearData () {
this.parent_id = ''
......
......@@ -555,7 +555,7 @@ export default {
this.clearFile()
})
.catch((errors) => {
self.$toast.error('something went wrong while trying create!', {
self.$toast.error(errors.response.data.message, {
duration: 3000
})
})
......@@ -628,7 +628,7 @@ export default {
})
.catch((error) => {
console.log(error)
self.$toast.error('something went wrong while trying update!', {
self.$toast.error(error.response.data.message, {
duration: 3000
})
})
......
......@@ -721,7 +721,7 @@ export default {
.catch((errors) => {
console.log(errors.response.data.message)
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!', {
self.$toast.error(errors.response.data.message, {
duration: 3000
})
})
......@@ -803,7 +803,7 @@ export default {
})
.catch((error) => {
console.log(error)
self.$toast.error('something went wrong while trying update!', {
self.$toast.error(error.response.data.message, {
duration: 3000
})
})
......
......@@ -403,7 +403,7 @@ export default {
this.validate()
console.log(errors.response.data.message)
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!', {
self.$toast.error(this.message, {
duration: 3000
})
})
......@@ -467,7 +467,7 @@ export default {
})
.catch((error) => {
console.log(error)
self.$toast.error('something went wrong while trying update!', {
self.$toast.error(this.message, {
duration: 3000
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment