refactor(actions): adopt endpoint client in remaining document reads
This commit is contained in:
@@ -6,38 +6,28 @@ import { buildHashedQueryUrl } from "../clients/relayClient";
|
||||
import { getJson, requestJson } from "../clients/endpointClient";
|
||||
|
||||
export const getAwaitingSubmissionFromBlob = (containerName) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
return getJson(
|
||||
BASE_URL +
|
||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||
containerName +
|
||||
hashAPIPath(
|
||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||
containerName +
|
||||
hashAPIPath(
|
||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||
containerName
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
containerName
|
||||
)
|
||||
).catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getRepsFromBlob = (containerName) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
"/api/file/getrepsblob?container=" +
|
||||
containerName +
|
||||
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
return getJson(
|
||||
BASE_URL +
|
||||
"/api/file/getrepsblob?container=" +
|
||||
containerName +
|
||||
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
|
||||
).catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getRepsFromBlobProxy = async (containerName) => {
|
||||
@@ -277,26 +267,21 @@ export const generateAppealPDF = async (
|
||||
};
|
||||
|
||||
export const getFilesFromBlob = (containerName, casefolderID) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
return getJson(
|
||||
BASE_URL +
|
||||
"/api/file/getbloblist?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
hashAPIPath(
|
||||
"/api/file/getbloblist?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
hashAPIPath(
|
||||
"/api/file/getbloblist?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID
|
||||
)
|
||||
).catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getFilesFromBlobHashed = (
|
||||
|
||||
@@ -1669,3 +1669,34 @@ Validation:
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
### 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