Refactor success and error messages
This commit is contained in:
@ -38,10 +38,10 @@ export default {
|
||||
.then(r => {
|
||||
this.$store.commit('currentList', r)
|
||||
this.$store.commit('namespaces/setListInNamespaceById', r)
|
||||
this.success({message: 'The list was successfully archived.'}, this)
|
||||
this.success({message: 'The list was successfully archived.'})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$router.back()
|
||||
|
@ -130,7 +130,7 @@ export default {
|
||||
})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
}, 300)
|
||||
},
|
||||
@ -144,10 +144,10 @@ export default {
|
||||
.then(l => {
|
||||
this.$store.commit(CURRENT_LIST, l)
|
||||
this.$store.commit('namespaces/setListInNamespaceById', l)
|
||||
this.success({message: 'The background has been set successfully!'}, this)
|
||||
this.success({message: 'The background has been set successfully!'})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
uploadBackground() {
|
||||
@ -159,10 +159,10 @@ export default {
|
||||
.then(l => {
|
||||
this.$store.commit(CURRENT_LIST, l)
|
||||
this.$store.commit('namespaces/setListInNamespaceById', l)
|
||||
this.success({message: 'The background has been set successfully!'}, this)
|
||||
this.success({message: 'The background has been set successfully!'})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
removeBackground() {
|
||||
@ -170,11 +170,11 @@ export default {
|
||||
.then(l => {
|
||||
this.$store.commit(CURRENT_LIST, l)
|
||||
this.$store.commit('namespaces/setListInNamespaceById', l)
|
||||
this.success({message: 'The background has been removed successfully!'}, this)
|
||||
this.success({message: 'The background has been removed successfully!'})
|
||||
this.$router.back()
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -31,11 +31,11 @@ export default {
|
||||
this.listService.delete(list)
|
||||
.then(() => {
|
||||
this.$store.commit('namespaces/removeListFromNamespaceById', list)
|
||||
this.success({message: 'The list was successfully deleted.'}, this)
|
||||
this.success({message: 'The list was successfully deleted.'})
|
||||
this.$router.push({name: 'home'})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -46,11 +46,11 @@ export default {
|
||||
.then(r => {
|
||||
this.$store.commit('namespaces/addListToNamespace', r.list)
|
||||
this.$store.commit('lists/setList', r.list)
|
||||
this.success({message: 'The list was successfully duplicated.'}, this)
|
||||
this.success({message: 'The list was successfully duplicated.'})
|
||||
this.$router.push({name: 'list.index', params: {listId: r.list.id}})
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -109,17 +109,17 @@ export default {
|
||||
this.setTitle(`Edit "${this.list.title}"`)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
save() {
|
||||
this.$store.dispatch('lists/updateList', this.list)
|
||||
.then(() => {
|
||||
this.success({message: 'The list was successfully updated.'}, this)
|
||||
this.success({message: 'The list was successfully updated.'})
|
||||
this.$router.back()
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -70,7 +70,7 @@ export default {
|
||||
this.setTitle(`Share "${this.list.title}"`)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
this.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user