committed by
Julius Härtl
parent
1e3ff41cb2
commit
725f99d8b8
@@ -47,6 +47,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
updateAttachment(state, { cardId, attachment }) {
|
||||
Vue.set(state.attachments, cardId, attachment)
|
||||
},
|
||||
|
||||
deleteAttachment(state, deletedAttachment) {
|
||||
const existingIndex = state.attachments[deletedAttachment.cardId].findIndex(a => a.id === deletedAttachment.id)
|
||||
if (existingIndex !== -1) {
|
||||
@@ -67,6 +71,11 @@ export default {
|
||||
commit('cardIncreaseAttachmentCount', cardId)
|
||||
},
|
||||
|
||||
async updateAttachment({ commit }, { cardId, attachmentId, formData }) {
|
||||
const attachment = await apiClient.updateAttachment({ cardId, attachmentId, formData })
|
||||
commit('updateAttachment', { cardId, attachment })
|
||||
},
|
||||
|
||||
async deleteAttachment({ commit }, attachment) {
|
||||
await apiClient.deleteAttachment(attachment)
|
||||
commit('deleteAttachment', attachment)
|
||||
|
||||
Reference in New Issue
Block a user