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,
|
required: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
attachments() {
|
attachments() {
|
||||||
return [...this.$store.getters.attachmentsByCard(this.cardId)].sort((a, b) => b.id - a.id)
|
return [...this.$store.getters.attachmentsByCard(this.cardId)].sort((a, b) => b.id - a.id)
|
||||||
|
|||||||
@@ -114,6 +114,11 @@ export default {
|
|||||||
return this.card.id
|
return this.card.id
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
card(newCard) {
|
||||||
|
this.$store.dispatch('fetchAttachments', newCard.id)
|
||||||
|
},
|
||||||
|
},
|
||||||
created: function() {
|
created: function() {
|
||||||
this.$store.dispatch('fetchAttachments', this.card.id)
|
this.$store.dispatch('fetchAttachments', this.card.id)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,11 +48,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
createAttachments(state, { cardId, attachments }) {
|
createAttachments(state, { cardId, attachments }) {
|
||||||
if (typeof state.attachments[cardId] === 'undefined') {
|
|
||||||
Vue.set(state.attachments, cardId, attachments)
|
Vue.set(state.attachments, cardId, attachments)
|
||||||
} else {
|
|
||||||
state.attachments[cardId].push(attachments)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
updateAttachment(state, { cardId, attachment }) {
|
updateAttachment(state, { cardId, attachment }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user