Refactor success and error messages
This commit is contained in:
@ -38,10 +38,10 @@ export default {
|
||||
this.namespaceService.update(this.namespace)
|
||||
.then(r => {
|
||||
this.$store.commit('namespaces/setNamespaceById', r)
|
||||
this.success({message: 'The namespace was successfully archived.'}, this)
|
||||
this.success({message: 'The namespace was successfully archived.'})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$router.back()
|
||||
|
@ -31,11 +31,11 @@ export default {
|
||||
|
||||
this.$store.dispatch('namespaces/deleteNamespace', namespace)
|
||||
.then(() => {
|
||||
this.success({message: 'The namespace was successfully deleted.'}, this)
|
||||
this.success({message: 'The namespace was successfully deleted.'})
|
||||
this.$router.push({name: 'home'})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -118,7 +118,7 @@ export default {
|
||||
this.setTitle(`Edit "${r.title}"`)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
save() {
|
||||
@ -126,11 +126,11 @@ export default {
|
||||
.then(r => {
|
||||
// Update the namespace in the parent
|
||||
this.$store.commit('namespaces/setNamespaceById', r)
|
||||
this.success({message: 'The namespace was successfully updated.'}, this)
|
||||
this.success({message: 'The namespace was successfully updated.'})
|
||||
this.$router.back()
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -69,7 +69,7 @@ export default {
|
||||
this.setTitle(`Share "${this.namespace.title}"`)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user