File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
source/app/blueprints/rest/v2/cases Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,12 @@ def rest_v2_cases_update(identifier):
171171 return ac_api_return_access_denied (caseid = identifier )
172172
173173 try :
174- case , _ = cases_update (identifier , request .get_json ())
174+ # TODO this is a bit of a hack, so that we have everywhere case_customer_id.
175+ # Should be moved down into method cases_update. But careful with the legacy.
176+ request_data = request .get_json ()
177+ if 'case_customer_id' in request_data :
178+ request_data ['case_customer' ] = request_data ['case_customer_id' ]
179+ case , _ = cases_update (identifier , request_data )
175180 return response_api_success (CaseSchemaForAPIV2 ().dump (case ))
176181 except BusinessProcessingError as e :
177182 return response_api_error (e .get_message ())
Original file line number Diff line number Diff line change @@ -220,5 +220,5 @@ def test_update_case_should_allow_to_update_customer(self):
220220 identifier = self ._subject .create_dummy_case ()
221221 response = self ._subject .create ('/manage/customers/add' , { 'customer_name' : f'customer{ uuid4 ()} ' }).json ()
222222 customer_identifier = response ['data' ]['customer_id' ]
223- response = self ._subject .update (f'/api/v2/cases/{ identifier } ' , {'case_customer ' : customer_identifier }).json ()
223+ response = self ._subject .update (f'/api/v2/cases/{ identifier } ' , {'case_customer_id ' : customer_identifier }).json ()
224224 self .assertEqual (customer_identifier , response ['case_customer_id' ])
You can’t perform that action at this time.
0 commit comments