refactor(api): migrate batch 7 endpoints to relayGet

This commit is contained in:
2026-03-24 09:43:17 +00:00
parent 6da6fdb4d2
commit bd15fd18e1
7 changed files with 188 additions and 194 deletions
+37
View File
@@ -902,3 +902,40 @@ Validation:
Follow-ups:
- Optional next bounded batch: migrate remaining legacy relay GET handlers in advanced/basic search-document/detail clusters that still use direct axios relay patterns.
---
### CL-024: TASK22229 P2-S2 Batch 7 (search-document + portal-proxy relay GET cluster)
date: 2026-03-24
author: Cline
scope: `pages/api/endpoint/{getportalmoduledetailsproxy_api,getsearchdocumentTypes_api,getsearchdocumentdetails_api,getsearchdocumentdetailspaged_api,getappealpdfdocuments_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
type: change
rationale: Continue P2-S2 in bounded commits by migrating a coherent search-document/portal-proxy GET cluster onto shared relay forwarding while preserving existing validation, transforms, and error contracts.
impact: Reduced duplicate relay plumbing and improved consistency in search-document handlers; no intended API contract changes.
status: completed
Summary:
- Migrated Batch 7 endpoints to shared `relayGet`:
- `getportalmoduledetailsproxy_api.js`
- `getsearchdocumentTypes_api.js`
- `getsearchdocumentdetails_api.js`
- `getsearchdocumentdetailspaged_api.js`
- `getappealpdfdocuments_api.js`
- Preserved existing guard behavior and error response contracts.
- Preserved endpoint-specific transform behavior via `transformData`, including:
- grouped search-document type payloads
- document hashlink enrichment and published-date normalization
- `@odata.nextLink` normalization where present
- appeal PDF document name projection
- Updated phase21 endpoint tests to mock `relayGet` for migrated handlers in validation/catch/success paths as applicable.
Validation:
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Continue with next bounded P2-S2 batch from remaining legacy GET endpoints (e.g., advanced/basic paged search-detail clusters and related non-migrated proxies).