10 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
5eaa6e566c fix: GET /api/dogs honours ?include_external=1 query param for pairing simulator 2026-03-11 01:00:48 -05:00
9738b24db6 feat(api): add is_external support — GET /api/dogs filters kennel dogs; GET /api/dogs/external returns external roster 2026-03-10 15:24:50 -05:00
0ade8586f9 feat(dogs): add hard DELETE /api/dogs/:id with cascade cleanup 2026-03-09 22:57:43 -05:00
421ea5cb58 feat(api): expose is_champion on all dog queries incl sire/dam/offspring joins 2026-03-09 22:24:39 -05:00
d311bc24a7 Clean: Proper sire/dam handling via parents table with logging 2026-03-09 02:01:18 -05:00
eec18daeea Fix: Remove weight/height columns - match actual schema 2026-03-09 01:38:42 -05:00
e62d35041f Fix: Don't return sire/dam columns from dogs table, select explicit fields 2026-03-09 01:29:40 -05:00
56fb9cb7af Fix: Convert empty microchip strings to NULL in database 2026-03-08 23:55:38 -05:00
e8c7d77c52 Add dogs API routes 2026-03-08 22:44:23 -05:00