@@ -64,37 +64,43 @@ export default {
6464
6565 } ,
6666 actions : {
67- async fetchAttachments ( { commit } , cardId ) {
68- const attachments = await apiClient . fetchAttachments ( cardId )
67+ async fetchAttachments ( { commit, rootState } , cardId ) {
68+ const boardId = rootState . currentBoard . id
69+ const attachments = await apiClient . fetchAttachments ( cardId , boardId )
6970 commit ( 'createAttachments' , { cardId, attachments } )
7071 commit ( 'cardSetAttachmentCount' , { cardId, count : attachments . length } )
7172 } ,
7273
73- async createAttachment ( { commit } , { cardId, formData, onUploadProgress } ) {
74- const attachment = await apiClient . createAttachment ( { cardId, formData, onUploadProgress } )
74+ async createAttachment ( { commit, rootState } , { cardId, formData, onUploadProgress } ) {
75+ const boardId = rootState . currentBoard . id
76+ const attachment = await apiClient . createAttachment ( { cardId, formData, onUploadProgress, boardId } )
7577 commit ( 'createAttachment' , { cardId, attachment } )
7678 commit ( 'cardIncreaseAttachmentCount' , cardId )
7779 } ,
7880
79- async updateAttachment ( { commit } , { cardId, attachment, formData } ) {
80- const result = await apiClient . updateAttachment ( { cardId, attachment, formData } )
81+ async updateAttachment ( { commit, rootState } , { cardId, attachment, formData } ) {
82+ const boardId = rootState . currentBoard . id
83+ const result = await apiClient . updateAttachment ( { cardId, attachment, formData, boardId } )
8184 commit ( 'updateAttachment' , { cardId, attachment : result } )
8285 } ,
8386
84- async deleteAttachment ( { commit } , attachment ) {
85- await apiClient . deleteAttachment ( attachment )
87+ async deleteAttachment ( { commit, rootState } , attachment ) {
88+ const boardId = rootState . currentBoard . id
89+ await apiClient . deleteAttachment ( attachment , boardId )
8690 commit ( 'deleteAttachment' , attachment )
8791 commit ( 'cardDecreaseAttachmentCount' , attachment . cardId )
8892 } ,
8993
90- async unshareAttachment ( { commit } , attachment ) {
91- await apiClient . deleteAttachment ( attachment )
94+ async unshareAttachment ( { commit, rootState } , attachment ) {
95+ const boardId = rootState . currentBoard . id
96+ await apiClient . deleteAttachment ( attachment , boardId )
9297 commit ( 'unshareAttachment' , attachment )
9398 commit ( 'cardDecreaseAttachmentCount' , attachment . cardId )
9499 } ,
95100
96- async restoreAttachment ( { commit } , attachment ) {
97- const restoredAttachment = await apiClient . restoreAttachment ( attachment )
101+ async restoreAttachment ( { commit, rootState } , attachment ) {
102+ const boardId = rootState . currentBoard . id
103+ const restoredAttachment = await apiClient . restoreAttachment ( attachment , boardId )
98104 commit ( 'restoreAttachment' , restoredAttachment )
99105 commit ( 'cardIncreaseAttachmentCount' , attachment . cardId )
100106 } ,
0 commit comments