Files
jandl-taskmanager-app/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue
T
2023-03-03 10:36:11 +01:00

54 lines
1.2 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ť <b>{{ mastertask.name }}</b>?</h1>
<v-icon
@click.stop="closeModal()"
icon="mdi-close"
size="large"
class="mb-15"
></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center">
<v-btn class="button primary half" variant="flat" @click="deleteMasterTask()">Á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: ['on-mastertask-deleted'],
data() {
return {
visible: false,
mastertask: null
}
},
methods: {
async showModal({ mastertask }) {
this.mastertask = mastertask
this.visible = true
},
closeModal() {
this.visible = false
},
async deleteMasterTask() {
try {
await this.$axios.delete_auth(`v1/mastertasks/${this.mastertask.id}`)
this.$emit('on-mastertask-deleted', this.mastertask)
this.closeModal()
} catch (error) {
this.$toast.error(error)
}
}
}
}
</script>