Implement the Events management page under /events.
Priority: P1
API endpoints used
| Method |
Endpoint |
Description |
| GET |
/events |
List all events (EventSummary[]) |
| POST |
/events |
Create a new event (EventCreate) |
| GET |
/events/{event_id} |
Get full event details (Event) |
| PATCH |
/events/{event_id} |
Update event fields (EventPartialUpdate) |
| DELETE |
/events/{event_id} |
Delete an event |
Tasks
- Add
src/features/events/api/queries.ts with useListEvents and useGetEvent hooks using TanStack Query; expose eventListQueryOptions and eventDetailQueryOptions for use in the route loader
- Add
src/features/events/api/mutations.ts with useCreateEvent, useUpdateEvent, and useDeleteEvent hooks; on success invalidate eventListQueryOptions
- Add
src/features/events/api/query-keys.ts for structured query keys
- Wire a React Router v7 loader on the
/events route that calls queryClient.ensureQueryData(eventListQueryOptions())
- Add Zod schema for
EventCreate and EventPartialUpdate derived from the generated types in src/api.ts
- Add Zustand slice for UI state only: selected event ID, detail sheet open/closed
- Build an events list view (shadcn/ui Table with columns:
name, start_time, end_time)
- Add an event detail Sheet showing all
Event fields including attendees, sports_linked, and teams_linked
- Add a "New Event" Dialog with a React Hook Form + Zod validated form for
EventCreate (required: name, start_time, end_time)
- Support edit (PATCH) and delete with confirmation from the detail Sheet
Acceptance criteria
- Events list loads from
GET /events before the page renders (via loader prefetch)
- Creating, editing, and deleting an event reflects in the list without a full page reload
- Form validates required fields (
name, start_time, end_time) before submitting and shows inline errors
- Dates are sent to the API as ISO-8601 and rendered consistently in the UI
Implement the Events management page under
/events.Priority: P1
API endpoints used
EventSummary[])EventCreate)Event)EventPartialUpdate)Tasks
src/features/events/api/queries.tswithuseListEventsanduseGetEventhooks using TanStack Query; exposeeventListQueryOptionsandeventDetailQueryOptionsfor use in the route loadersrc/features/events/api/mutations.tswithuseCreateEvent,useUpdateEvent, anduseDeleteEventhooks; on success invalidateeventListQueryOptionssrc/features/events/api/query-keys.tsfor structured query keys/eventsroute that callsqueryClient.ensureQueryData(eventListQueryOptions())EventCreateandEventPartialUpdatederived from the generated types insrc/api.tsname,start_time,end_time)Eventfields includingattendees,sports_linked, andteams_linkedEventCreate(required:name,start_time,end_time)Acceptance criteria
GET /eventsbefore the page renders (via loader prefetch)name,start_time,end_time) before submitting and shows inline errors