File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 3.7.25
1+ 3.7.26
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class AssociateClients < BaseAction
4343 RESULT_HEADER = [
4444 :id ,
4545 :status ,
46- :originalProject ,
46+ :project ,
4747 :client ,
4848 :type
4949 ]
@@ -102,7 +102,13 @@ def call(params)
102102 options = { delete_projects : delete_projects }
103103 options . merge! ( delete_extra_option ( params , delete_extra ) ) if delete_extra
104104
105- domain . update_clients ( params . clients , options )
105+ results = domain . update_clients ( params . clients , options )
106+ # Update status to CREATED if the client has no project
107+ results &.each do |r |
108+ r [ :status ] = 'CREATED' if r [ :originalProject ] . nil?
109+ r [ :project ] = r [ :originalProject ]
110+ end
111+ results
106112 end
107113
108114 private
Original file line number Diff line number Diff line change @@ -456,10 +456,12 @@ def update_clients_settings(data)
456456 alias_method :add_clients_settings , :update_clients_settings
457457
458458 def update_clients ( data , options = { } )
459+ results = [ ]
459460 data . group_by ( &:data_product_id ) . each do |data_product_id , client_update_data |
460461 data_product = data_products ( data_product_id )
461- data_product . update_clients ( client_update_data , options )
462+ results . concat data_product . update_clients ( client_update_data , options )
462463 end
464+ results
463465 end
464466
465467 # Update user in domain
You can’t perform that action at this time.
0 commit comments