Skip to content

Commit

Permalink
fix get all users by ids funct
Browse files Browse the repository at this point in the history
  • Loading branch information
fjpacheco committed Apr 18, 2024
1 parent c1c28a8 commit 9269198
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def get_users(user_id: int):
def get_all_users(ids: Annotated[Union[List[str], None], Query()] = None):
if ids:
ids = ids[0].split(",")
return users_controller.handle_get_all_users(ids)
else:
return users_controller.handle_get_all_users()
if len(ids) > 0:
ids = filter(lambda x: x.isdigit(), ids)
return users_controller.handle_get_all_users(ids)

return users_controller.handle_get_all_users()


@app.post("/users")
Expand Down

0 comments on commit 9269198

Please sign in to comment.