Fix attachment not being added if the task was not a kanban task
This commit is contained in:
parent
23552b2b1b
commit
4df33d1152
2 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue