Fix teams endpoint to return results sorted by ID ascending

Added default order_by(Team.id.asc()) to get_teams endpoint to ensure
consistent ordering of results.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-12-03 13:30:50 -06:00
parent 8f4f4aa321
commit ef67b716e7
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
2.1.2 2.1.3

View File

@ -43,9 +43,9 @@ async def get_teams(
team_abbrev: list = Query(default=None), active_only: Optional[bool] = False, team_abbrev: list = Query(default=None), active_only: Optional[bool] = False,
short_output: Optional[bool] = False, csv: Optional[bool] = False): short_output: Optional[bool] = False, csv: Optional[bool] = False):
if season is not None: if season is not None:
all_teams = Team.select_season(season) all_teams = Team.select_season(season).order_by(Team.id.asc())
else: else:
all_teams = Team.select() all_teams = Team.select().order_by(Team.id.asc())
if manager_id is not None: if manager_id is not None:
managers = Manager.select().where(Manager.id << manager_id) managers = Manager.select().where(Manager.id << manager_id)