1
0

Refactor success and error messages

This commit is contained in:
kolaente
2021-06-22 22:07:57 +02:00
parent ab4edc17de
commit cdc805c8da
55 changed files with 219 additions and 256 deletions

View File

@ -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))

View File

@ -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)
})
},
},

View File

@ -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()

View File

@ -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)
})
},
},

View File

@ -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)
})
},
},

View File

@ -69,7 +69,7 @@ export default {
this.setTitle(`Share "${this.namespace.title}"`)
})
.catch(e => {
this.error(e, this)
this.error(e)
})
},
},