Skip to content

Commit

Permalink
minor fix to json encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertSnows committed Nov 19, 2024
1 parent 4914ffe commit d55ab7c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gen3userdatalibrary/routes/lists_by_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
parse_and_auth_request,
validate_items,
)
from gen3userdatalibrary.utils.core import update
from gen3userdatalibrary.utils.modeling import create_user_list_instance

lists_by_id_router = APIRouter()
Expand Down Expand Up @@ -66,9 +65,8 @@ async def get_list_by_id(
status_code=status.HTTP_404_NOT_FOUND, content="list_id not found!"
)
else:
data = update("id", lambda ul_id: str(ul_id), result.to_dict())
resp_content = {str(result.id): data}
response = JSONResponse(status_code=status.HTTP_200_OK, content=resp_content)
data = jsonable_encoder(result)
response = JSONResponse(status_code=status.HTTP_200_OK, content=data)
return response


Expand Down

0 comments on commit d55ab7c

Please sign in to comment.