Move all caching to helper
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
backportbot-nextcloud[bot]
parent
33913be41f
commit
6a790154c2
@@ -84,6 +84,7 @@ export default {
|
||||
async fetchAttachments({ commit }, cardId) {
|
||||
const attachments = await apiClient.fetchAttachments(cardId)
|
||||
commit('createAttachments', { cardId, attachments })
|
||||
commit('cardSetAttachmentCount', { cardId, count: attachments.length })
|
||||
},
|
||||
|
||||
async createAttachment({ commit }, { cardId, formData, onUploadProgress }) {
|
||||
|
||||
@@ -252,6 +252,12 @@ export default {
|
||||
}
|
||||
Vue.set(state.cards[existingIndex], 'lastModified', Date.now() / 1000)
|
||||
},
|
||||
cardSetAttachmentCount(state, { cardId, count }) {
|
||||
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)
|
||||
if (existingIndex !== -1) {
|
||||
Vue.set(state.cards[existingIndex], 'attachmentCount', count)
|
||||
}
|
||||
},
|
||||
cardIncreaseAttachmentCount(state, cardId) {
|
||||
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)
|
||||
if (existingIndex !== -1) {
|
||||
|
||||
Reference in New Issue
Block a user