1
0

chore: don't resolve when returning from promise & improve list store module

This commit is contained in:
Dominik Pschenitschni
2021-10-09 16:34:57 +02:00
parent 3b940cb56c
commit a776e1d2f3
16 changed files with 130 additions and 150 deletions

View File

@ -119,7 +119,7 @@ export default {
}
},
created() {
this.loadLabels()
this.$store.dispatch('labels/loadAllLabels')
},
mounted() {
this.setTitle(this.$t('label.title'))
@ -131,20 +131,11 @@ export default {
loading: state => state[LOADING] && state[LOADING_MODULE] === 'labels',
}),
methods: {
loadLabels() {
this.$store.dispatch('labels/loadAllLabels')
},
deleteLabel(label) {
this.$store.dispatch('labels/deleteLabel', label)
.then(() => {
this.$message.success({message: this.$t('label.deleteSuccess')})
})
return this.$store.dispatch('labels/deleteLabel', label)
},
editLabelSubmit() {
this.$store.dispatch('labels/updateLabel', this.labelEditLabel)
.then(() => {
this.$message.success({message: this.$t('label.edit.success')})
})
return this.$store.dispatch('labels/updateLabel', this.labelEditLabel)
},
editLabel(label) {
if (label.createdBy.id !== this.userInfo.id) {