fix: actually deleting the list now works
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2022-04-25 19:59:02 +02:00
parent 8578225982
commit b40d6f783c
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 9 additions and 3 deletions

View File

@ -12,7 +12,9 @@
<p>
<strong v-if="totalTasks !== null" class="has-text-white">
{{ totalTasks > 0 ? $t('list.delete.tasksToDelete', {count: totalTasks}) : $t('list.delete.noTasksToDelete') }}
{{
totalTasks > 0 ? $t('list.delete.tasksToDelete', {count: totalTasks}) : $t('list.delete.noTasksToDelete')
}}
</strong>
<Loading v-else class="is-loading-small"/>
</p>
@ -45,6 +47,10 @@ const list = computed(() => store.getters['lists/getListById'](route.params.list
watchEffect(
() => {
if (!route.params.lisId) {
return
}
const taskCollectionService = new TaskCollectionService()
taskCollectionService.getAll({listId: route.params.listId}).then(() => {
totalTasks.value = taskCollectionService.totalPages * taskCollectionService.resultCount
@ -52,10 +58,10 @@ watchEffect(
},
)
useTitle(() => t('list.delete.title', {list: list.value.title}))
useTitle(() => t('list.delete.title', {list: list?.value?.title}))
async function deleteList() {
await store.dispatch('lists/deleteList', list)
await store.dispatch('lists/deleteList', list.value)
success({message: t('list.delete.success')})
router.push({name: 'home'})
}