mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
54 lines
1.1 KiB
Vue
54 lines
1.1 KiB
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ť task z masterTasku <b>{{ task.project_code }}</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="deleteTask()">Á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-task-deleted'],
|
|
|
|
data() {
|
|
return {
|
|
visible: false,
|
|
task: null
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
async showModal(task) {
|
|
this.task = task
|
|
this.visible = true
|
|
},
|
|
|
|
closeModal() {
|
|
this.visible = false
|
|
},
|
|
|
|
async deleteTask() {
|
|
try {
|
|
await this.$axios.delete(`v1/subtasks/${this.task.id}`)
|
|
this.$emit('on-task-deleted', this.task)
|
|
this.closeModal()
|
|
} catch (error) {
|
|
this.$toast.error(error)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script> |