-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge HAN-138: Agregar endpoint para obtener usuarios con filtro por …
…nickname (#25)
- Loading branch information
1 parent
ef9c108
commit 4134552
Showing
8 changed files
with
138 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Tests | |
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from fastapi import Query | ||
from typing import Optional | ||
|
||
|
||
def get_query_params(query_params_dic: dict): | ||
filters = {} | ||
for filterName, value in query_params_dic.items(): | ||
if value is not None: | ||
filters[filterName] = value.lower() if value is str else value | ||
return filters | ||
|
||
|
||
class GetUsersQueryParams: | ||
def __init__( | ||
self, | ||
offset: Optional[int] = Query(0, ge=0), | ||
limit: Optional[int] = Query(200, le=200), | ||
ids: Optional[str] = Query(None), | ||
nickname: Optional[str] = Query(None), | ||
): | ||
self.query_params = { | ||
'offset': offset, | ||
'limit': limit, | ||
'ids': ids, | ||
'nickname': nickname | ||
} | ||
|
||
def get_query_params(self): | ||
return get_query_params(self.query_params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters