From 2d65fe8f52ec070167aa7b9851aaddde82d81a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 31 Jan 2023 16:28:07 +0100 Subject: [PATCH] . --- app/src/plugins/tm@modal/team/z-team-modal.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/src/plugins/tm@modal/team/z-team-modal.vue b/app/src/plugins/tm@modal/team/z-team-modal.vue index 35b525a..d31b461 100644 --- a/app/src/plugins/tm@modal/team/z-team-modal.vue +++ b/app/src/plugins/tm@modal/team/z-team-modal.vue @@ -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) } },