Merge pull request 'fix: add type annotations to untyped path parameters (#27)' (#43) from ai/paper-dynasty-database#27 into next-release
Reviewed-on: #43
This commit is contained in:
commit
9096a4b976
@ -109,7 +109,7 @@ async def get_packs(
|
||||
|
||||
|
||||
@router.get('/{pack_id}')
|
||||
async def get_one_pack(pack_id, csv: Optional[bool] = False):
|
||||
async def get_one_pack(pack_id: int, csv: Optional[bool] = False):
|
||||
try:
|
||||
this_pack = Pack.get_by_id(pack_id)
|
||||
except Exception:
|
||||
|
||||
@ -587,7 +587,7 @@ async def search_players(
|
||||
|
||||
|
||||
@router.get("/{player_id}")
|
||||
async def get_one_player(player_id, csv: Optional[bool] = False):
|
||||
async def get_one_player(player_id: int, csv: Optional[bool] = False):
|
||||
try:
|
||||
this_player = Player.get_by_id(player_id)
|
||||
except Exception:
|
||||
@ -1119,7 +1119,7 @@ async def post_image_reset(
|
||||
|
||||
|
||||
@router.delete("/{player_id}")
|
||||
async def delete_player(player_id, token: str = Depends(oauth2_scheme)):
|
||||
async def delete_player(player_id: int, token: str = Depends(oauth2_scheme)):
|
||||
if not valid_token(token):
|
||||
logging.warning(f"Bad Token: {token}")
|
||||
raise HTTPException(
|
||||
|
||||
@ -173,7 +173,7 @@ async def get_teams(
|
||||
|
||||
|
||||
@router.get("/{team_id}")
|
||||
async def get_one_team(team_id, inc_packs: bool = True, csv: Optional[bool] = False):
|
||||
async def get_one_team(team_id: int, inc_packs: bool = True, csv: Optional[bool] = False):
|
||||
try:
|
||||
this_team = Team.get_by_id(team_id)
|
||||
except Exception:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user