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>Ste si istý, že chcete zmazať task z mastertasku <b>{{ subtask.project_code }}</b>?</h1>
@@ -12,7 +12,7 @@
></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="deleteTask()">ÁNO</v-btn>
<v-btn class="button primary half" variant="flat" @click="deleteTask()" :disabled="isDeleting">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
@@ -26,7 +26,8 @@ export default {
data() {
return {
visible: false,
subtask: null
subtask: null,
isDeleting: false
}
},
@@ -41,6 +42,10 @@ export default {
},
async deleteTask() {
if (this.isDeleting) return
this.isDeleting = true
try {
await this.$axios.delete_auth(`v1/subtasks/${this.subtask.id}`)
@@ -49,6 +54,8 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(error)
} finally {
this.isDeleting = false
}
}
}