Archive Page
Notes
- 2026-08-18 bug fix (entirely-portal 6273df5): Archive.tsx requested /portal/projects?limit=5000 but the endpoint caps limit at 1000 (Query le=1000), so every load 422’d and a bare catch rendered the page empty with no error. Fixed by requesting status=Closed&limit=1000 — status=Closed also bypasses the endpoint’s default active-only filter (include_closed=False) that would otherwise hide all archived projects; the backend’s underlying fetch caps at 1000 records so paging beyond that is impossible server-side. Silent catch replaced with a visible error state + Retry button. Portal rebuilt and pushed.
- 2026-08-18 follow-up: replaced the fetch-everything design with true server-side paging. New endpoint GET /portal/projects/archive (entirely-api 7d12036) filters, searches, and pages in Postgres — Closed + older than 90 days (inspection_date, first_created fallback, ET boundary), ilike search over address/permit/customer#/bc_job#/project_id/owner, branch filter on account_ss_id, order by inspection_date desc nulls last, count=exact. Role gate up_owner/up_admin/triage; triage scoped to JES branch accounts. Page rows hydrated via list_records_by_ids + shared _format_page helper (extracted from list_projects) so output shape is identical to the main list. Archive.tsx (entirely-portal 885541b) now passes search/branch/page as query params and holds only one 50-row page. Verified live: owners see all 5,313 archived (was capped at ~1,000 of 5,392 Closed), deep offsets/search/branch/scoping/error codes all correct, 884 API tests pass. No ceiling to re-hit — scales with archive growth.