feat(people): add pagination support to getAllPeople endpoint

Support optional page, limit, and search query params.
Returns { data, total, page, totalPages } when paginated,
plain array for backward compatibility.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Mohammed AbadandCopilot committed 2026-04-27 13:29:16 +01:00
1 parent 8aca121b10
commit 6d676d803c
5 files changed
+57 -87

No files matched your search

+20 -3
View File
@@ -41,12 +41,29 @@ See [[Models#People]] and [[Models#Credit]].
## Pages
- [[Pages#PeoplePage|PeoplePage]] — Browse and search people
- [[Pages#PersonDetailsPage|PersonDetailsPage]] — Full profile + filmography
- [[Pages#PersonTmdbRedirectPage|PersonTmdbRedirectPage]] — TMDB ID → local redirect
- [[Pages#PeoplePage|PeoplePage]] — Browse and search people (server-side paginated, 48 per page)
- [[Pages#PersonDetailsPage|PersonDetailsPage]] — Unified person page handling both local DB IDs (`/people/:id`) and TMDB IDs (`/people/tmdb/:tmdbId`)
### PersonDetailsPage Modes
| Route | Mode | Data Source | Actions |
|---|---|---|---|
| `/people/:id` | Local DB | `GET /people/:id` + TMDB filmography | Favorite toggle |
| `/people/tmdb/:tmdbId` | TMDB Preview | `GET /people/tmdb/preview/:tmdbId` | Add to Library (saves with `pinned: true`) |
Both modes share the same `PersonMeta` component (shows department, birthday, place of birth, TMDB external link) and `FilmographySection` (splits credits into "In Library" / "Not in Library" with pagination).
## API Endpoints
### Pagination
`GET /people` now supports optional query params:
- `page` (number) — Page number (1-based)
- `limit` (number) — Items per page
- `search` (string) — Filter by name (LIKE match)
When `page` and `limit` are provided, returns `{ data, total, page, totalPages }`. Without them, returns a plain array for backward compatibility.
See [[API Reference#People]].
## Hooks