Use message mixin for handling success and error messages (#51)

Use message mixin everywhere

Add mixin for success and error messages

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/51
This commit is contained in:
konrad 2020-01-30 21:47:08 +00:00
parent a0c4732f81
commit 1170e030f6
25 changed files with 94 additions and 116 deletions

View file

@ -95,7 +95,6 @@
import LabelService from '../../services/label'
import LabelModel from '../../models/label'
import message from '../../message'
import auth from '../../auth'
export default {
@ -124,7 +123,7 @@
this.$set(this, 'labels', r)
})
.catch(e => {
message.error(e, this)
this.error(e, this)
})
},
deleteLabel(label) {
@ -136,10 +135,10 @@
this.labels.splice(l, 1)
}
}
message.success({message: 'The label was successfully deleted.'}, this)
this.success({message: 'The label was successfully deleted.'}, this)
})
.catch(e => {
message.error(e, this)
this.error(e, this)
})
},
editLabelSubmit() {
@ -150,10 +149,10 @@
this.$set(this.labels, l, r)
}
}
message.success({message: 'The label was successfully updated.'}, this)
this.success({message: 'The label was successfully updated.'}, this)
})
.catch(e => {
message.error(e, this)
this.error(e, this)
})
},
editLabel(label) {