refactor(actions): adopt endpoint client in remaining document reads
This commit is contained in:
@@ -6,8 +6,7 @@ import { buildHashedQueryUrl } from "../clients/relayClient";
|
|||||||
import { getJson, requestJson } from "../clients/endpointClient";
|
import { getJson, requestJson } from "../clients/endpointClient";
|
||||||
|
|
||||||
export const getAwaitingSubmissionFromBlob = (containerName) => {
|
export const getAwaitingSubmissionFromBlob = (containerName) => {
|
||||||
return axios
|
return getJson(
|
||||||
.get(
|
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
@@ -15,27 +14,18 @@ export const getAwaitingSubmissionFromBlob = (containerName) => {
|
|||||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||||
containerName
|
containerName
|
||||||
)
|
)
|
||||||
)
|
).catch((error) => {
|
||||||
.then((res) => {
|
|
||||||
return res.data;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getRepsFromBlob = (containerName) => {
|
export const getRepsFromBlob = (containerName) => {
|
||||||
return axios
|
return getJson(
|
||||||
.get(
|
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getrepsblob?container=" +
|
"/api/file/getrepsblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
|
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
|
||||||
)
|
).catch((error) => {
|
||||||
.then((res) => {
|
|
||||||
return res.data;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -277,8 +267,7 @@ export const generateAppealPDF = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getFilesFromBlob = (containerName, casefolderID) => {
|
export const getFilesFromBlob = (containerName, casefolderID) => {
|
||||||
return axios
|
return getJson(
|
||||||
.get(
|
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
@@ -290,11 +279,7 @@ export const getFilesFromBlob = (containerName, casefolderID) => {
|
|||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID
|
casefolderID
|
||||||
)
|
)
|
||||||
)
|
).catch((error) => {
|
||||||
.then((res) => {
|
|
||||||
return res.data;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1669,3 +1669,34 @@ Validation:
|
|||||||
Follow-ups:
|
Follow-ups:
|
||||||
|
|
||||||
- Optional next bounded slice: evaluate remaining legacy direct `axios.get(...).then(res.data)` helpers in `documentDirectService` (`getAwaitingSubmissionFromBlob`, `getRepsFromBlob`, `getFilesFromBlob`) for safe migration while preserving signed hash path behavior.
|
- Optional next bounded slice: evaluate remaining legacy direct `axios.get(...).then(res.data)` helpers in `documentDirectService` (`getAwaitingSubmissionFromBlob`, `getRepsFromBlob`, `getFilesFromBlob`) for safe migration while preserving signed hash path behavior.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-046: TASK22260 next slice — document direct service remaining signed GET helper migration
|
||||||
|
|
||||||
|
date: 2026-03-25
|
||||||
|
author: Cline
|
||||||
|
scope: `actions/services/documentDirectService.js`
|
||||||
|
type: change
|
||||||
|
rationale: Complete the remaining low-risk read helper migration in document service by replacing final direct `axios.get(...).then(res.data)` patterns with shared `getJson` while retaining hash/signature query construction.
|
||||||
|
impact: Finishes consistency pass for JSON-returning document read helpers and reduces duplicated response extraction logic.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated the remaining signed document read helpers to `getJson(...)`:
|
||||||
|
- `getAwaitingSubmissionFromBlob`
|
||||||
|
- `getRepsFromBlob`
|
||||||
|
- `getFilesFromBlob`
|
||||||
|
- Preserved existing behavior:
|
||||||
|
- same BASE_URL and hash query composition via `hashAPIPath(...)`
|
||||||
|
- same catch-path logging behavior (`consoleLogger`)
|
||||||
|
- no changes to delete/download flows or hash-signing helper usage in mutation paths
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Optional next bounded slice: targeted hygiene in `documentDirectService` to isolate remaining non-migrated special-case flows (`downloadBlob`, delete helpers) and assess if any shared client abstraction is beneficial without altering behavior.
|
||||||
|
|||||||
Reference in New Issue
Block a user