feat: allow marking a related task done directly from the list

This commit is contained in:
kolaente 2022-09-07 17:47:07 +02:00 committed by Dominik Pschenitschni
parent 943d5f7975
commit ce0f58c783
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
5 changed files with 60 additions and 33 deletions

View file

@ -25,8 +25,9 @@ import type { IAttachment } from '@/modelTypes/IAttachment'
import type { IList } from '@/modelTypes/IList'
import type { RootStoreState, TaskState } from '@/store/types'
import { useLabelStore } from '@/stores/labels'
import { useListStore } from '@/stores/lists'
import {useLabelStore} from '@/stores/labels'
import {useListStore} from '@/stores/lists'
import {playPop} from '@/helpers/playPop'
// IDEA: maybe use a small fuzzy search here to prevent errors
function findPropertyByValue(object, key, value) {
@ -96,6 +97,9 @@ const tasksStore : Module<TaskState, RootStoreState>= {
try {
const updatedTask = await taskService.update(task)
ctx.commit('kanban/setTaskInBucket', updatedTask, {root: true})
if (task.done) {
playPop()
}
return updatedTask
} finally {
cancel()