44 lines
1.7 KiB
Markdown
44 lines
1.7 KiB
Markdown
|
|
---
|
||
|
|
# nuzlocke-tracker-2fp1
|
||
|
|
title: Show owner info in admin pages
|
||
|
|
status: in-progress
|
||
|
|
type: feature
|
||
|
|
priority: normal
|
||
|
|
created_at: 2026-03-21T12:18:51Z
|
||
|
|
updated_at: 2026-03-21T12:37:36Z
|
||
|
|
parent: nuzlocke-tracker-wwnu
|
||
|
|
---
|
||
|
|
|
||
|
|
## Problem
|
||
|
|
|
||
|
|
Admin pages (`AdminRuns.tsx`, `AdminGenlockes.tsx`) don't show which user owns each run or genlocke. This makes it hard for admins to manage content.
|
||
|
|
|
||
|
|
## Approach
|
||
|
|
|
||
|
|
### Backend
|
||
|
|
- The `/api/runs` list endpoint already returns run data — verify it includes `owner` (id + email). If not, add it to the response schema.
|
||
|
|
- For genlockes, ownership is inferred from the first leg's run owner. Add an `owner` field to the genlocke list response that resolves from the first leg's run.
|
||
|
|
|
||
|
|
### Frontend
|
||
|
|
- `AdminRuns.tsx`: Add an "Owner" column showing the owner's email (or "No owner" for legacy runs)
|
||
|
|
- `AdminGenlockes.tsx`: Add an "Owner" column showing the inferred owner from the first leg's run
|
||
|
|
- Add owner filter dropdown to both pages
|
||
|
|
|
||
|
|
## Files to modify
|
||
|
|
|
||
|
|
- `backend/src/app/api/runs.py` — verify owner is included in list response
|
||
|
|
- `backend/src/app/api/genlockes.py` — add owner resolution to list endpoint
|
||
|
|
- `backend/src/app/schemas/genlocke.py` — add owner field to `GenlockeListItem`
|
||
|
|
- `frontend/src/pages/admin/AdminRuns.tsx` — add Owner column + filter
|
||
|
|
- `frontend/src/pages/admin/AdminGenlockes.tsx` — add Owner column + filter
|
||
|
|
- `frontend/src/types/game.ts` — update types if needed
|
||
|
|
|
||
|
|
## Checklist
|
||
|
|
|
||
|
|
- [x] Verify runs list API includes owner info; add if missing
|
||
|
|
- [x] Add owner resolution to genlocke list endpoint (from first leg's run)
|
||
|
|
- [x] Update `GenlockeListItem` schema to include owner
|
||
|
|
- [x] Add Owner column to `AdminRuns.tsx`
|
||
|
|
- [x] Add Owner column to `AdminGenlockes.tsx`
|
||
|
|
- [x] Add owner filter to both admin pages
|