diff --git a/database_client/database_client.py b/database_client/database_client.py index df493232..81e9245b 100644 --- a/database_client/database_client.py +++ b/database_client/database_client.py @@ -1179,11 +1179,12 @@ def _build_column_references( right_link_column="location_id", linked_relation=Relations.LOCATIONS_EXPANDED, linked_relation_linking_column="id", - columns_to_retrieve=["state_name", "county_name", "locality_name"], + columns_to_retrieve=["state_name", "county_name", "locality_name", "id"], alias_mappings={ "state_name": "state", "county_name": "county", "locality_name": "locality", + "id": "location_id", }, ) diff --git a/middleware/schema_and_dto_logic/primary_resource_schemas/search_schemas.py b/middleware/schema_and_dto_logic/primary_resource_schemas/search_schemas.py index a6050b6f..3eda624f 100644 --- a/middleware/schema_and_dto_logic/primary_resource_schemas/search_schemas.py +++ b/middleware/schema_and_dto_logic/primary_resource_schemas/search_schemas.py @@ -176,6 +176,10 @@ class FollowSearchResponseSchema(Schema): "The locality of the search. If empty, all localities for the given county will be searched." ), ) + location_id = fields.Int( + required=True, + metadata=get_json_metadata("The location ID of the search."), + ) GetUserFollowedSearchesSchema = create_get_many_schema( diff --git a/tests/integration/test_search.py b/tests/integration/test_search.py index 694de984..367a1614 100644 --- a/tests/integration/test_search.py +++ b/tests/integration/test_search.py @@ -256,6 +256,7 @@ def follow_extant_location( "state": TEST_STATE, "county": TEST_COUNTY, "locality": TEST_LOCALITY, + "location_id": sts.location_id }], "message": "Followed searches found.", },