diff --git a/dlx_rest/api/__init__.py b/dlx_rest/api/__init__.py index 7663631f..03905a02 100644 --- a/dlx_rest/api/__init__.py +++ b/dlx_rest/api/__init__.py @@ -1640,8 +1640,8 @@ def get(self): abort(404, 'Maximum limit is 1000') if args.identifier: - if args.identifierType: - this_identifier = Identifier(args.identifierType, args.identifier) + if args.identifier_type: + this_identifier = Identifier(args.identifier_type, args.identifier) if args.language: # Get files for identifier by language @@ -1650,9 +1650,9 @@ def get(self): # Get all files for that identifier data = [URL('api_file_record', record_id=f.id).to_str() for f in File.find_by_identifier(this_identifier)] else: - abort(404, 'Param "identifierType" required with param "identifier"') - elif args.identifierType and not args.identifier: - abort(404, 'Param "identifier" required with param "identifierType"') + abort(404, 'Param "identifier_type" required with param "identifier"') + elif args.identifier_type and not args.identifier: + abort(404, 'Param "identifier" required with param "identifier_type"') else: data = [URL('api_file_record', record_id=f.id).to_str() for f in File.find({}, skip=start - 1, limit=limit)] diff --git a/dlx_rest/tests/test_api.py b/dlx_rest/tests/test_api.py index 66ed4250..36fbb856 100644 --- a/dlx_rest/tests/test_api.py +++ b/dlx_rest/tests/test_api.py @@ -695,11 +695,11 @@ def test_api_files(client, files): data = check_response(res) assert f'{API}/files/f20d9f2072bbeb6691c0f9c5099b01f3' in data['data'] - res = client.get(f'{API}/files?identifierType=isbn&identifier=x') + res = client.get(f'{API}/files?identifier_type=isbn&identifier=x') data = check_response(res) assert f'{API}/files/f20d9f2072bbeb6691c0f9c5099b01f3' in data['data'] - res = client.get(f'{API}/files?identifierType=isbn&identifier=x&language=en') + res = client.get(f'{API}/files?identifier_type=isbn&identifier=x&language=en') data = check_response(res) assert f'{API}/files/f20d9f2072bbeb6691c0f9c5099b01f3' in data['data']