Fix attachments being added mutliple times
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user