refactor(api): migrate batch 6 endpoints to relayGet
This commit is contained in:
@@ -870,3 +870,35 @@ Validation:
|
||||
Follow-ups:
|
||||
|
||||
- Continue P2-S2 with next bounded batch (e.g. search/listing cluster) as a separate commit if required.
|
||||
|
||||
---
|
||||
|
||||
### CL-023: TASK22229 P2-S2 Batch 6 (profile/form/document-history/portal-module relay GET cluster)
|
||||
|
||||
date: 2026-03-24
|
||||
author: Cline
|
||||
scope: `pages/api/endpoint/{getpersonalaccount_api,getformdata_api,getsearchdocumenthistory_api,getsearchdocumenthistorypaged_api,getportalmoduledetails_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||
type: change
|
||||
rationale: Execute requested Batch 6 by migrating the next bounded set of read-only endpoint handlers to shared `relayGet` while preserving existing request validation and response/error contracts.
|
||||
impact: Reduced endpoint relay boilerplate and improved consistency; no intended behavior contract changes.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- Migrated Batch 6 endpoints to shared `relayGet`:
|
||||
- `getpersonalaccount_api.js`
|
||||
- `getformdata_api.js`
|
||||
- `getsearchdocumenthistory_api.js` (uses `requestOptionsBuilder` with `azureHeadersPaged`)
|
||||
- `getsearchdocumenthistorypaged_api.js` (uses `requestOptionsBuilder` with `azureHeadersPaged`)
|
||||
- `getportalmoduledetails_api.js`
|
||||
- Preserved all existing required-query validation guards and existing error codes/messages.
|
||||
- Updated Phase 21 endpoint contract tests to inject `relayGet` mocks for migrated handlers (validation path, catch path, and success path where 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:
|
||||
|
||||
- Optional next bounded batch: migrate remaining legacy relay GET handlers in advanced/basic search-document/detail clusters that still use direct axios relay patterns.
|
||||
|
||||
Reference in New Issue
Block a user