mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
53 lines
1.1 KiB
Vue
53 lines
1.1 KiB
Vue
<template>
|
|
<v-dialog v-model="visible" max-width="750">
|
|
<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="closeModal()" icon="mdi-close" size="large"></v-icon>
|
|
</div>
|
|
|
|
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
|
<v-btn class="button primary half" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
|
|
<v-btn class="button primary half outline" @click.stop="closeModal()">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
|
|
},
|
|
|
|
closeModal() {
|
|
this.visible = false
|
|
},
|
|
|
|
async deleteTeam() {
|
|
try {
|
|
await this.$axios.delete_auth(`v1/teams/${this.team.id}`)
|
|
this.visible = false
|
|
this.$emit('update', this.team)
|
|
this.$store.commit('tm/delete_team', this.team)
|
|
} catch (error) {
|
|
this.$toast.error(error)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|