Wire photo upload on player profile edit page #42
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#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Feature
Lineage
plan-wkq→ Phase 11 → Girls Tryout prep (profile completion)Repo
forgejo_admin/westside-appUser Story
As a parent
I want to upload or update my player's photo from their profile page
So that the profile is complete for team placement
Context
The player profile page (
/players/[id]) has an edit mode with a file input for photo upload (lines 222-228), but it's not connected to the backend. The backend endpoint (POST /upload/photo) already exists in basketball-api and works — accepts JPG/PNG/WebP up to 5MB, returnsphoto_url. The registration form already uploads photos successfully using the same endpoint. This just needs the profile page wired the same way.The profile currently shows initials as the avatar. After upload, it should show the actual photo. If the player already has a
photo_urlfrom registration, it should display that too (it doesn't currently).File Targets
Files the agent should modify:
src/routes/players/[id]/+page.svelte— wire the existing file input (line 227) to callPOST /upload/photo, thenPUT /players/{id}with the returnedphoto_url. Also displayplayer.photo_urlif it exists instead of initials.src/lib/api.js— may need aapiUpload()helper for multipart/form-data if one doesn't exist (check registration form for existing pattern)Files the agent should NOT touch:
src/routes/register/+page.svelte— registration photo upload already worksAcceptance Criteria
photo_url(from registration or profile edit), the avatar shows the photo instead of initialsTest Expectations
npm run check(Svelte type check)Constraints
apiFetchpattern insrc/lib/api.jssrc/routes/register/+page.sveltefor the existing photo upload pattern and reuse itChecklist
Related
phase-wkq-11-girls-tryout— pre-team-placement profile completion