Commit Graph

7 Commits

Author SHA1 Message Date
jason
b8633863b0 fix: add pagination to unbounded GET endpoints
All list endpoints now accept ?page and ?limit (default 50, max 200) and
return { data, total, page, limit } instead of a bare array, preventing
memory and performance failures at scale.

- GET /api/dogs: adds pagination, server-side search (?search) and sex
  filter (?sex), and a stats aggregate (total/males/females) for the
  Dashboard to avoid counting from the array
- GET /api/litters: adds pagination; also fixes N+1 query by fetching
  all puppies for the current page in a single query instead of one per
  litter
- DogList: moves search/sex filtering server-side with 300ms debounce;
  adds Prev/Next pagination controls
- LitterList: uses paginated response; adds Prev/Next pagination controls
- Dashboard: reads counts from stats/total fields instead of array length
- LitterDetail, LitterForm: switch dogs fetch to /api/dogs/all (complete
  list, no pagination, for sire/dam dropdowns)
- DogForm: updates litters fetch to use paginated response shape

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 16:40:28 -05:00
13185a5281 Roadmap 2,3,4 2026-03-11 23:48:35 -05:00
e44883b5e0 feat(dogs): add delete button with confirm modal on DogList 2026-03-09 22:58:41 -05:00
9e699e308f feat: DogList — render ChampionBadge and ChampionBloodlineBadge on dog cards 2026-03-09 22:18:28 -05:00
32b45a4fb3 Redesign: Horizontal info cards with avatars for Dogs list 2026-03-08 23:31:02 -05:00
89e9593eaf Integrate DogForm into DogList for add functionality 2026-03-08 23:03:42 -05:00
36bcdb1095 Add DogList page 2026-03-08 22:53:37 -05:00