File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
stac_fastapi/elasticsearch/stac_fastapi/elasticsearch Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ class CoreClient(AsyncBaseCoreClient):
5252 async def all_collections (self , ** kwargs ) -> Collections :
5353 """Read all collections from the database."""
5454 base_url = str (kwargs ["request" ].base_url )
55- collection_list = await self .database .get_all_collections (base_url = base_url )
55+ collection_list = await self .database .get_all_collections ()
56+ collection_list = [
57+ self .collection_serializer .db_to_stac (c , base_url = base_url )
58+ for c in collection_list
59+ ]
5660
5761 links = [
5862 {
Original file line number Diff line number Diff line change @@ -66,15 +66,13 @@ class DatabaseLogic:
6666
6767 """CORE LOGIC"""
6868
69- async def get_all_collections (self , base_url : str ) -> List [Collection ]:
69+ async def get_all_collections (self ) -> List [Collection ]:
7070 """Database logic to retrieve a list of all collections."""
7171 # https://github.com/stac-utils/stac-fastapi-elasticsearch/issues/65
7272 # collections should be paginated, but at least return more than the default 10 for now
7373 collections = await self .client .search (index = COLLECTIONS_INDEX , size = 1000 )
74-
7574 return [
76- self .collection_serializer .db_to_stac (c ["_source" ], base_url = base_url )
77- for c in collections ["hits" ]["hits" ]
75+ c ["_source" ] for c in collections ["hits" ]["hits" ]
7876 ]
7977
8078 async def get_one_item (self , collection_id : str , item_id : str ) -> Dict :
You can’t perform that action at this time.
0 commit comments