feat: use async / await where it makes sense
This commit is contained in:
parent
a776e1d2f3
commit
bb94c1ba3a
74 changed files with 1458 additions and 1662 deletions
|
|
@ -49,22 +49,19 @@ export default {
|
|||
this.setTitle(this.$t('team.create.title'))
|
||||
},
|
||||
methods: {
|
||||
newTeam() {
|
||||
async newTeam() {
|
||||
if (this.team.name === '') {
|
||||
this.showError = true
|
||||
return
|
||||
}
|
||||
this.showError = false
|
||||
|
||||
this.teamService
|
||||
.create(this.team)
|
||||
.then((response) => {
|
||||
this.$router.push({
|
||||
name: 'teams.edit',
|
||||
params: { id: response.id },
|
||||
})
|
||||
this.$message.success({message: this.$t('team.create.success') })
|
||||
})
|
||||
const response = await this.teamService.create(this.team)
|
||||
this.$router.push({
|
||||
name: 'teams.edit',
|
||||
params: { id: response.id },
|
||||
})
|
||||
this.$message.success({message: this.$t('team.create.success') })
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue