Bug: Teams page empty — API response not unwrapped #143

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

Type

Bug

Lineage

Standalone — discovered during session investigating teams page blank render.

Repo

forgejo_admin/westside-app

What Broke

Teams page renders empty — no Kings or Queens rosters display. The publicFetch('/public/teams') call returns {teams: [...]} (wrapped object) but the page assigns the entire object to the teams variable instead of extracting the array. Calling .filter() on an object silently returns nothing.

src/routes/(public)/teams/+page.svelte line 16:

const data = await publicFetch('/public/teams');
teams = data;  // BUG: data is {teams: [...]}, not an array

Repro Steps

  1. Navigate to /teams on the public site
  2. Observe: page loads but no team cards render
  3. Open browser console — no error (.filter() on object fails silently)

Expected Behavior

Teams page displays Kings and Queens rosters with player details, filtered by the Kings/Queens toggle.

Environment

  • Cluster/namespace: prod
  • Service version: current main branch
  • Related alerts: none (silent failure)

Acceptance Criteria

  • Teams page renders rosters for both Kings and Queens
  • Kings/Queens toggle filters correctly
  • Handles empty API response gracefully (no crash)
  • No regression in other public pages
  • project-westside-basketball — project this affects
  • forgejo_admin/basketball-api — companion fix needed for missing fields (separate issue)
### Type Bug ### Lineage Standalone — discovered during session investigating teams page blank render. ### Repo `forgejo_admin/westside-app` ### What Broke Teams page renders empty — no Kings or Queens rosters display. The `publicFetch('/public/teams')` call returns `{teams: [...]}` (wrapped object) but the page assigns the entire object to the `teams` variable instead of extracting the array. Calling `.filter()` on an object silently returns nothing. `src/routes/(public)/teams/+page.svelte` line 16: ```javascript const data = await publicFetch('/public/teams'); teams = data; // BUG: data is {teams: [...]}, not an array ``` ### Repro Steps 1. Navigate to `/teams` on the public site 2. Observe: page loads but no team cards render 3. Open browser console — no error (`.filter()` on object fails silently) ### Expected Behavior Teams page displays Kings and Queens rosters with player details, filtered by the Kings/Queens toggle. ### Environment - Cluster/namespace: prod - Service version: current main branch - Related alerts: none (silent failure) ### Acceptance Criteria - [ ] Teams page renders rosters for both Kings and Queens - [ ] Kings/Queens toggle filters correctly - [ ] Handles empty API response gracefully (no crash) - [ ] No regression in other public pages ### Related - `project-westside-basketball` — project this affects - `forgejo_admin/basketball-api` — companion fix needed for missing fields (separate issue)
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/westside-landing#143
No description provided.