feat: use async / await where it makes sense
This commit is contained in:
@ -60,21 +60,19 @@ export default {
|
||||
loading: state => state[LOADING] && state[LOADING_MODULE] === 'labels',
|
||||
}),
|
||||
methods: {
|
||||
newLabel() {
|
||||
async newLabel() {
|
||||
if (this.label.title === '') {
|
||||
this.showError = true
|
||||
return
|
||||
}
|
||||
this.showError = false
|
||||
|
||||
this.$store.dispatch('labels/createLabel', this.label)
|
||||
.then(r => {
|
||||
this.$router.push({
|
||||
name: 'labels.index',
|
||||
params: {id: r.id},
|
||||
})
|
||||
this.$message.success({message: this.$t('label.create.success')})
|
||||
})
|
||||
const label = this.$store.dispatch('labels/createLabel', this.label)
|
||||
this.$router.push({
|
||||
name: 'labels.index',
|
||||
params: {id: label.id},
|
||||
})
|
||||
this.$message.success({message: this.$t('label.create.success')})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user