Bug: Public teams endpoint missing division field + school name mismatch #211

Closed
opened 2026-03-28 18:45:42 +00:00 by forgejo_admin · 0 comments

Type

Bug

Lineage

Standalone — discovered during session investigating westside-app teams page blank render. Companion to forgejo_admin/westside-app teams unwrap bug.

Repo

forgejo_admin/basketball-api

What Broke

GET /public/teams returns PublicTeamResponse without division or age_group fields. The westside-app frontend filters teams by program (kings=boys, queens=girls) using the division field — since it's missing, all teams fail the filter and the page renders empty.

Additionally, PublicPlayerResponse uses current_school but westside-app reads player.school — school info doesn't display.

Affected schema in src/basketball_api/routes/public.py:

class PublicTeamResponse(BaseModel):
    id: int
    name: str
    coach_name: str | None
    players: list[PublicPlayerResponse]
    # MISSING: division, age_group

Repro Steps

  1. curl https://basketball-api.tail5b443a.ts.net/public/teams
  2. Observe: response teams have no division or age_group field
  3. Observe: players have current_school not school

Expected Behavior

Each team in the response includes division (boys/girls) and age_group. Player objects use school field name matching frontend expectation.

Environment

  • Cluster/namespace: prod
  • Service version: current main branch
  • Related alerts: none

Acceptance Criteria

  • GET /public/teams returns division per team
  • GET /public/teams returns age_group per team
  • Player objects use school field name (or alias)
  • westside-app teams page filters correctly into Kings/Queens
  • No regression in other public endpoints
  • Existing tests updated
  • project-westside-basketball — project this affects
  • forgejo_admin/westside-app — companion frontend fix for response unwrapping
### Type Bug ### Lineage Standalone — discovered during session investigating westside-app teams page blank render. Companion to `forgejo_admin/westside-app` teams unwrap bug. ### Repo `forgejo_admin/basketball-api` ### What Broke `GET /public/teams` returns `PublicTeamResponse` without `division` or `age_group` fields. The westside-app frontend filters teams by program (kings=boys, queens=girls) using the `division` field — since it's missing, all teams fail the filter and the page renders empty. Additionally, `PublicPlayerResponse` uses `current_school` but westside-app reads `player.school` — school info doesn't display. Affected schema in `src/basketball_api/routes/public.py`: ```python class PublicTeamResponse(BaseModel): id: int name: str coach_name: str | None players: list[PublicPlayerResponse] # MISSING: division, age_group ``` ### Repro Steps 1. `curl https://basketball-api.tail5b443a.ts.net/public/teams` 2. Observe: response teams have no `division` or `age_group` field 3. Observe: players have `current_school` not `school` ### Expected Behavior Each team in the response includes `division` (boys/girls) and `age_group`. Player objects use `school` field name matching frontend expectation. ### Environment - Cluster/namespace: prod - Service version: current main branch - Related alerts: none ### Acceptance Criteria - [ ] `GET /public/teams` returns `division` per team - [ ] `GET /public/teams` returns `age_group` per team - [ ] Player objects use `school` field name (or alias) - [ ] westside-app teams page filters correctly into Kings/Queens - [ ] No regression in other public endpoints - [ ] Existing tests updated ### Related - `project-westside-basketball` — project this affects - `forgejo_admin/westside-app` — companion frontend fix for response unwrapping
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#211
No description provided.