This commit is contained in:
Matej Glasnák committed 2023-01-31 16:28:07 +01:00
1 parent 8754a2d93c
commit 2d65fe8f52
1 file changed
+5 -8
@@ -121,21 +121,18 @@ export default {
},
async save() {
if (!(await this.v$.$validate()))
return
if (!(await this.v$.$validate())) return
try {
if (this.team.id) {
await this.$axios.post_auth(`v1/teams/${this.team.id}`, this.team)
this.$emit('update', this.team)
}
if (this.team.id)
await this.$axios.patch_auth(`v1/teams/${this.team.id}`, this.team)
else
await this.$axios.post_auth(`v1/teams`, this.team)
this.$emit('update', this.team)
this.$emit('update', this.team)
this.closeModal()
} catch (error) {
this.$toast(error)
this.$toast.error(error)
}
},