Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhealy1 committed Nov 4, 2023
1 parent 158f256 commit e562d97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ async def all_collections(self, **kwargs) -> Collections:
request: Request = kwargs["request"]
base_url = str(kwargs["request"].base_url)

limit = int(request.query_params["limit"]) if "limit" in request.query_params else 10
token = request.query_params["token"] if "token" in request.query_params else None
limit = (
int(request.query_params["limit"])
if "limit" in request.query_params
else 10
)
token = (
request.query_params["token"] if "token" in request.query_params else None
)

hits = await self.database.get_all_collections(limit=limit, token=token)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ async def get_all_collections(
if token:
search_after = urlsafe_b64decode(token.encode()).decode().split(",")
collections = await self.client.search(
index=COLLECTIONS_INDEX, search_after=search_after, size=limit, sort={"id": {"order": "asc"}}
index=COLLECTIONS_INDEX,
search_after=search_after,
size=limit,
sort={"id": {"order": "asc"}},
)
hits = collections["hits"]["hits"]
return hits
Expand Down

0 comments on commit e562d97

Please sign in to comment.