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" max-height="90%" height="700px">
<v-dialog v-model="visible" max-width="750" max-height="90%" height="700px" persistent>
<W-loadable :content="blocker" class="h-100">
<v-card height="100%" class="d-flex flex-column">
<div class="d-flex justify-space-between align-center modal-header">
@@ -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ť <b>{{ blocker.name }}</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="deleteBlocker()">ÁNO</v-btn>
<v-btn class="button primary half" variant="flat" @click="deleteBlocker()" :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,
blocker: null
blocker: null,
isDeleting: false
}
},
@@ -41,6 +42,10 @@ export default {
},
async deleteBlocker() {
if (this.isDeleting) return
this.isDeleting = true
try {
await this.$axios.delete_auth(`v1/blockers/${this.blocker.id}`)
@@ -48,6 +53,8 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(error)
} finally {
this.isDeleting = false
}
}
}