Skip to content

Commit

Permalink
refactor: change expected data type of pid #268
Browse files Browse the repository at this point in the history
- This matches the PaNOSC data model
  • Loading branch information
MRichards99 committed Jan 13, 2022
1 parent b0f4b13 commit 71a0852
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions datagateway_api/src/api_start_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def create_api_endpoints(flask_app, api, spec):
get_single_endpoint_resource = get_single_endpoint(entity_name)
api.add_resource(
get_single_endpoint_resource,
f"{search_api_extension}/{endpoint_name}/<int:pid>",
f"{search_api_extension}/{endpoint_name}/<string:pid>",
endpoint=f"search_api_get_single_{endpoint_name}",
)
spec.path(resource=get_single_endpoint_resource, api=api)
Expand All @@ -260,7 +260,7 @@ def create_api_endpoints(flask_app, api, spec):
get_files_endpoint_resource = get_files_endpoint("File")
api.add_resource(
get_files_endpoint_resource,
f"{search_api_extension}/datasets/<int:pid>/files",
f"{search_api_extension}/datasets/<string:pid>/files",
endpoint="search_api_get_dataset_files",
)
spec.path(resource=get_files_endpoint_resource, api=api)
Expand All @@ -270,7 +270,7 @@ def create_api_endpoints(flask_app, api, spec):
)
api.add_resource(
get_number_count_files_endpoint_resource,
f"{search_api_extension}/datasets/<int:pid>/files/count",
f"{search_api_extension}/datasets/<string:pid>/files/count",
endpoint="search_api_count_dataset_files",
)
spec.path(resource=get_number_count_files_endpoint_resource, api=api)
Expand Down
2 changes: 1 addition & 1 deletion datagateway_api/src/resources/search_api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
get_files,
get_files_count,
get_search,
get_with_id,
get_with_pid,
)

log = logging.getLogger()
Expand Down

0 comments on commit 71a0852

Please sign in to comment.