mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
[Modals] Refactoring
This commit is contained in:
1 parent
707526fb2d
commit
e1d9e6302f
18 files changed
+292
-465
No files matched your search
@@ -19,7 +19,7 @@
|
||||
<img class="pencil-icon" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon">
|
||||
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="showDeleteModal = { task }">
|
||||
|
||||
<A-delete-task-modal v-if="showDeleteModal" :show="showDeleteModal" :task="showDeleteModal.task" @delete-task="deleteTask(showDeleteModal.task.id)" @close-modal="(showDeleteModal = null)" />
|
||||
<Z-delete-task-modal v-if="showDeleteModal" :visible="showDeleteModal ? true : false" :task="showDeleteModal.task" @close="showDeleteModal = null" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -28,11 +28,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ADeleteTaskModal from '@/plugins/app/_components/a-delete-task-modal.vue'
|
||||
import ZDeleteTaskModal from '@/plugins/tm@modal/task/z-delete-task-modal.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ADeleteTaskModal
|
||||
ZDeleteTaskModal
|
||||
},
|
||||
|
||||
props: {
|
||||
@@ -46,17 +46,6 @@ export default {
|
||||
return {
|
||||
showDeleteModal: null
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
async deleteTask(id) {
|
||||
try {
|
||||
await this.$axios.delete(`v1/teams/${id}`)
|
||||
this.showDeleteModal = false
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user