Files
jandl-taskmanager-app/app/src/plugins/tm@modal/team/z-delete-team-modal.vue
T
2023-02-02 11:18:02 +01:00

47 lines
1016 B
Vue

<template>
<v-dialog v-model="visible" max-width="650">
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>
Ste si istý, že chcete zmazať tím <b>{{ team.name }}</b>?
</h1>
<v-icon @click.stop="visible = false" icon="mdi-close" size="large"></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center">
<v-btn class="z-btn" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
<v-btn class="ml-7 cancel-btn" @click.stop="visible = false">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
emits: ['update'],
data() {
return {
visible: false,
team: null,
}
},
methods: {
async showModal(team) {
this.team = team
this.visible = true
},
async deleteTeam() {
try {
await this.$axios.delete_auth(`v1/teams/${this.team.id}`)
this.visible = false
this.$emit('update', this.team)
} catch (error) {
this.$toast.error(error)
}
}
}
}
</script>