fix: filter teams by division field from API response #156
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/westside-landing!156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "155-fix-teams-filter-division"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
t.program/t.genderbut API returnst.divisiont.division === 'boys'/t.division === 'girls'Closes #155
Test Plan
The frontend filtered on t.program/t.gender but the API returns t.division ('boys'/'girls'). All teams failed the filter, rendering the page empty despite 7 teams being returned. Closes #155 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>PR #156 Review
DOMAIN REVIEW
Tech stack: SvelteKit 5 (Svelte runes --
$derived,$state), vanilla CSS, public-facing teams page.Fix correctness: The diff changes two filter expressions on lines 65-66 from:
to:
This is correct. The API returns team objects with a
divisionfield ("boys"/"girls"), notprogramorgender. The old filter matched on nonexistent properties, so every team failed the predicate and both tabs rendered empty. The fix aligns the filter with the actual API response shape.Codebase consistency verified: Searched the entire
src/tree fort.program,t.gender,team.program,team.gender-- zero remaining references. The rest of the codebase (admin teams page, player detail, registration, jersey page) already usesdivisionconsistently. This was the only stale reference.Note on
programin interest form (line 34): Theprogram: programStore.valuein the interest form POST body is intentionallyprogram-- it sends the UI toggle value ('kings'/'queens'), not the API'sdivisionfield. This is correct and unrelated to the bug.Scope: 1 file changed, 2 additions, 2 deletions. Minimal, surgical fix. No scope creep.
BLOCKERS
None.
This is a 2-line bugfix correcting a data property name mismatch. No new functionality is introduced, so the BLOCKER criteria (test coverage for new functionality, input validation, secrets, DRY violations) do not apply. The existing page structure, rendering logic, and API call are all unchanged.
NITS
None. The fix is clean and minimal.
SOP COMPLIANCE
155-fix-teams-filter-divisionfollows{issue-number}-{kebab-case-purpose}conventionCloses #155fix: filter teams by division field from API responseMissing from PR body:
## Relatedsection with plan slug. For a standalone bugfix with no parent plan, this is acceptable.PROCESS OBSERVATIONS
program/gender) that did not match the actual response (division). This is a common integration bug -- worth considering TypeScript interfaces or JSDoc type definitions for API response shapes to catch these at dev time.VERDICT: APPROVED