File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -201,15 +201,23 @@ export const projectState = function (state=initialState, action) {
201201 state . project . attachments . forEach ( a => {
202202 if ( a . category === `product#${ prd . id } ` ) {
203203 attachments . push ( a )
204- // TODO remove `a` from project's attachments
205204 }
206205 } )
207206 }
208207 return { ...prd , attachments }
209208 } )
210209 return p
211210 } )
211+ // updates projects' attachments which are not coupled with any product/phase
212+ let projectAttachments = [ ]
213+ state . project . attachments . forEach ( a => {
214+ if ( ! a . category || a . category . indexOf ( 'product' ) !== 0 ) {
215+ projectAttachments . push ( a )
216+ }
217+ } )
212218 return update ( state , {
219+ project : { attachments : { $set : projectAttachments } } ,
220+ projectNonDirty : { attachments : { $set : projectAttachments } } ,
213221 phases : { $set :phases } ,
214222 phasesNonDirty : { $set : action . payload } ,
215223 isLoadingPhases : { $set : false }
You can’t perform that action at this time.
0 commit comments