fix: add type annotations to untyped path parameters (#27)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
761c0a6dab
commit
8f3f4d1d58
@ -109,7 +109,7 @@ async def get_packs(
|
|||||||
|
|
||||||
|
|
||||||
@router.get('/{pack_id}')
|
@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:
|
try:
|
||||||
this_pack = Pack.get_by_id(pack_id)
|
this_pack = Pack.get_by_id(pack_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@ -587,7 +587,7 @@ async def search_players(
|
|||||||
|
|
||||||
|
|
||||||
@router.get("/{player_id}")
|
@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:
|
try:
|
||||||
this_player = Player.get_by_id(player_id)
|
this_player = Player.get_by_id(player_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
@ -1119,7 +1119,7 @@ async def post_image_reset(
|
|||||||
|
|
||||||
|
|
||||||
@router.delete("/{player_id}")
|
@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):
|
if not valid_token(token):
|
||||||
logging.warning(f"Bad Token: {token}")
|
logging.warning(f"Bad Token: {token}")
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|||||||
@ -176,7 +176,7 @@ async def get_teams(
|
|||||||
|
|
||||||
|
|
||||||
@router.get("/{team_id}")
|
@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:
|
try:
|
||||||
this_team = Team.get_by_id(team_id)
|
this_team = Team.get_by_id(team_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user