This commit is contained in:
romankko2 committed 2023-07-21 16:23:26 +02:00
1 parent 0e8e3a8b32
commit 1032a30031
15 files changed
+56 -27

No files matched your search

@@ -1,5 +1,5 @@
<template>
<v-dialog v-model="visible" max-width="750">
<v-dialog v-model="visible" max-width="750" persistent>
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>
@@ -9,7 +9,7 @@
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
<v-btn class="button primary half" variant="flat" @click="deleteTeam()" :disabled="isDeleting">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
@@ -23,7 +23,8 @@ export default {
data() {
return {
visible: false,
team: null
team: null,
isDeleting: false
}
},
@@ -38,6 +39,9 @@ export default {
},
async deleteTeam() {
if (this.isDeleting) return
this.isDeleting = true
try {
await this.$axios.delete_auth(`v1/teams/${this.team.id}`)
this.visible = false
@@ -45,6 +49,8 @@ export default {
this.$store.commit('tm/delete_team', this.team)
} catch (error) {
this.$toast.error(error)
} finally {
this.isDeleting = false
}
}
}