Fix attachment not being added if the task was not a kanban task

This commit is contained in:
kolaente 2021-01-28 21:24:22 +01:00
parent 23552b2b1b
commit 4df33d1152
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,6 @@ export default {
console.debug(`Uploaded attachments for task ${this.taskId}, response was`, r)
if (r.success !== null) {
r.success.forEach(a => {
this.$store.commit('attachments/removeById', a.id)
this.$store.dispatch('tasks/addTaskAttachment', {
taskId: this.taskId,
attachment: a,

View File

@ -41,6 +41,7 @@ export default {
addTaskAttachment(ctx, {taskId, attachment}) {
const t = ctx.rootGetters['kanban/getTaskById'](taskId)
if (t.task === null) {
ctx.commit('attachments/add', attachment, {root: true})
return
}
t.task.attachments.push(attachment)