refactor(actions): complete case read migration to endpoint client
This commit is contained in:
@@ -235,27 +235,19 @@ export const patchCase = async (incidentid) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getCase = (incidentID) => {
|
export const getCase = (incidentID) => {
|
||||||
return axios
|
return getJson(
|
||||||
.get(BASE_URL + "/api/endpoint/getcase_api?incidentID=" + incidentID)
|
BASE_URL + "/api/endpoint/getcase_api?incidentID=" + incidentID
|
||||||
.then((res) => {
|
).catch((error) => {
|
||||||
return res.data;
|
consoleLogger(error);
|
||||||
})
|
});
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCaseByID = (incidentID) => {
|
export const getCaseByID = (incidentID) => {
|
||||||
return axios
|
return getJson(
|
||||||
.get(
|
BASE_URL + "/api/endpoint/getcasebyid_api?incidentID=" + incidentID
|
||||||
BASE_URL + "/api/endpoint/getcasebyid_api?incidentID=" + incidentID
|
).catch((error) => {
|
||||||
)
|
consoleLogger(error);
|
||||||
.then((res) => {
|
});
|
||||||
return res.data;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAppealPDFDocs = (incidentID) => {
|
export const getAppealPDFDocs = (incidentID) => {
|
||||||
@@ -269,19 +261,14 @@ export const getAppealPDFDocs = (incidentID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getAppealPDFDocument = async (incidentid) => {
|
export const getAppealPDFDocument = async (incidentid) => {
|
||||||
return axios
|
return getJson(
|
||||||
.get(
|
BASE_URL +
|
||||||
BASE_URL +
|
"/api/endpoint/getappealpdfdocuments_api?incidentid=" +
|
||||||
"/api/endpoint/getappealpdfdocuments_api?incidentid=" +
|
incidentid
|
||||||
incidentid
|
).catch((error) => {
|
||||||
)
|
consoleLogger(error);
|
||||||
.then((res) => {
|
return error.response;
|
||||||
return res.data;
|
});
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
return error.response;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPortalModuleDetails = async (appealType, caseReference) => {
|
export const getPortalModuleDetails = async (appealType, caseReference) => {
|
||||||
|
|||||||
@@ -1765,3 +1765,36 @@ Validation:
|
|||||||
Follow-ups:
|
Follow-ups:
|
||||||
|
|
||||||
- Optional next bounded slice: evaluate remaining GET helpers in `caseDirectService` with custom catches (`getCase`, `getCaseByID`, `getAppealPDFDocument`) for selective migration where return-shape contracts remain stable.
|
- Optional next bounded slice: evaluate remaining GET helpers in `caseDirectService` with custom catches (`getCase`, `getCaseByID`, `getAppealPDFDocument`) for selective migration where return-shape contracts remain stable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-049: TASK22260 next slice — case direct service remaining GET helper migration
|
||||||
|
|
||||||
|
date: 2026-03-25
|
||||||
|
author: Cline
|
||||||
|
scope: `actions/services/caseDirectService.js`
|
||||||
|
type: change
|
||||||
|
rationale: Complete the remaining safe GET-helper client migration in case service by moving custom-catch read functions to `getJson` while preserving their existing return-shape/error handling behavior.
|
||||||
|
impact: Removes remaining direct axios GET response-extraction boilerplate in case read helpers and completes endpointClient read-path consistency for this service subset.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated remaining targeted case read helpers from direct `axios.get(...).then(res.data)` to `getJson(...)`:
|
||||||
|
- `getCase`
|
||||||
|
- `getCaseByID`
|
||||||
|
- `getAppealPDFDocument`
|
||||||
|
- Preserved behavior contracts:
|
||||||
|
- unchanged request URL/query construction
|
||||||
|
- unchanged catch semantics:
|
||||||
|
- `getCase` / `getCaseByID` still log via `consoleLogger`
|
||||||
|
- `getAppealPDFDocument` still logs and returns `error.response` on failure
|
||||||
|
- left non-targeted POST/update/create/patch flows unchanged.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Optional next bounded slice: evaluate config-based POST helpers in `caseDirectService` (`createNewCase`, `createNewCaseBlob`, `updateCase`, `updateCaseBlob`) for selective `requestJson(...)` adoption while preserving existing side effects and error contracts.
|
||||||
|
|||||||
Reference in New Issue
Block a user