feat: don't rethrow same error and handle errors globally

This commit is contained in:
Dominik Pschenitschni 2021-10-09 16:04:19 +02:00
parent 6f51921588
commit 3b940cb56c
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
71 changed files with 69 additions and 451 deletions

View file

@ -185,14 +185,8 @@ export default {
},
},
methods: {
findTasks(query) {
this.taskService.getAll({}, {s: query})
.then(response => {
this.foundTasks = response
})
.catch(e => {
this.$message.error(e)
})
async findTasks(query) {
this.foundTasks = await this.taskService.getAll({}, {s: query})
},
addTaskRelation() {
let rel = new TaskRelationModel({
@ -213,9 +207,6 @@ export default {
this.saved = false
}, 2000)
})
.catch(e => {
this.$message.error(e)
})
},
removeTaskRelation() {
const rel = new TaskRelationModel({
@ -237,9 +228,6 @@ export default {
this.saved = false
}, 2000)
})
.catch(e => {
this.$message.error(e)
})
.finally(() => {
this.showDeleteModal = false
})
@ -251,9 +239,6 @@ export default {
this.newTaskRelationTask = r
this.addTaskRelation()
})
.catch(e => {
this.$message.error(e)
})
},
relationKindTitle(kind, length) {
return this.$tc(`task.relation.kinds.${kind}`, length)