1
0

feature/remove-attachment-upload-mixin (#724)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/724
Reviewed-by: konrad <k@knt.li>
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
dpschen
2021-09-24 18:16:37 +00:00
committed by konrad
parent 4f2378ff02
commit 41331c8a86
7 changed files with 54 additions and 59 deletions

View File

@ -58,12 +58,11 @@ export default {
// This is an action to be able to commit other mutations
addTaskAttachment(ctx, {taskId, attachment}) {
const t = ctx.rootGetters['kanban/getTaskById'](taskId)
if (t.task === null) {
ctx.commit('attachments/add', attachment, {root: true})
return
if (t.task !== null) {
const newTask = { ...t }
newTask.task.attachments.push(attachment)
ctx.commit('kanban/setTaskInBucketByIndex', newTask, {root: true})
}
t.task.attachments.push(attachment)
ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true})
ctx.commit('attachments/add', attachment, {root: true})
},
addAssignee(ctx, {user, taskId}) {