1
0

Fix attachments being added mutliple times

This commit is contained in:
kolaente
2021-01-28 19:29:50 +01:00
parent c5da0fcba4
commit 23552b2b1b
2 changed files with 4 additions and 1 deletions

View File

@ -14,10 +14,10 @@ export default {
const attachmentModel = new AttachmentModel({taskId: this.taskId})
attachmentService.create(attachmentModel, files)
.then(r => {
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.commit('attachments/add', a)
this.$store.dispatch('tasks/addTaskAttachment', {
taskId: this.taskId,
attachment: a,