Merge pull request #2059 from nextcloud/bugfix/noid/attachment-fetch

Fix fetching attachments on card change
This commit is contained in:
Julius Härtl
2020-06-26 09:44:15 +02:00
committed by GitHub
3 changed files with 6 additions and 10 deletions

View File

@@ -83,11 +83,6 @@ export default {
required: false,
},
},
data() {
return {
}
},
computed: {
attachments() {
return [...this.$store.getters.attachmentsByCard(this.cardId)].sort((a, b) => b.id - a.id)

View File

@@ -114,6 +114,11 @@ export default {
return this.card.id
},
},
watch: {
card(newCard) {
this.$store.dispatch('fetchAttachments', newCard.id)
},
},
created: function() {
this.$store.dispatch('fetchAttachments', this.card.id)
},

View File

@@ -48,11 +48,7 @@ export default {
},
createAttachments(state, { cardId, attachments }) {
if (typeof state.attachments[cardId] === 'undefined') {
Vue.set(state.attachments, cardId, attachments)
} else {
state.attachments[cardId].push(attachments)
}
Vue.set(state.attachments, cardId, attachments)
},
updateAttachment(state, { cardId, attachment }) {