Refactor success and error messages
This commit is contained in:
@ -131,7 +131,7 @@ export default {
|
||||
this.$set(this.backgrounds, l.id, b)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -144,7 +144,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$store.dispatch('lists/toggleListFavorite', list)
|
||||
.catch(e => this.error(e, this))
|
||||
.catch(e => this.error(e))
|
||||
},
|
||||
saveShowArchivedState() {
|
||||
localStorage.setItem('showArchived', JSON.stringify(this.showArchived))
|
||||
|
@ -80,14 +80,11 @@ export default {
|
||||
.create(this.namespace)
|
||||
.then((r) => {
|
||||
this.$store.commit('namespaces/addNamespace', r)
|
||||
this.success(
|
||||
{ message: 'The namespace was successfully created.' },
|
||||
this
|
||||
)
|
||||
this.success({message: 'The namespace was successfully created.'})
|
||||
this.$router.back()
|
||||
})
|
||||
.catch((e) => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -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