Merge pull request #2059 from nextcloud/bugfix/noid/attachment-fetch
Fix fetching attachments on card change
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
|
||||
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user