Skip to content

Commit

Permalink
Merge pull request #636 from materialsproject/bugfix/key_endpoint_pag…
Browse files Browse the repository at this point in the history
…ination

Prefix `fields` input for read resource key endpoint
  • Loading branch information
munrojm committed Apr 21, 2022
2 parents 9ba1260 + 709293a commit b68e7d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/maggma/api/resource/read_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async def get_by_key(
request: Request,
response: Response,
key: str = Path(..., alias=key_name, title=f"The {key_name} of the {model_name} to get",),
fields: STORE_PARAMS = Depends(field_input),
_fields: STORE_PARAMS = Depends(field_input),
):
f"""
Get's a document by the primary key in the store
Expand All @@ -125,7 +125,7 @@ async def get_by_key(
"""
self.store.connect()

item = [self.store.query_one(criteria={self.store.key: key}, properties=fields["properties"],)]
item = [self.store.query_one(criteria={self.store.key: key}, properties=_fields["properties"],)]

if item == [None]:
raise HTTPException(
Expand Down

0 comments on commit b68e7d7

Please sign in to comment.