From f4471c57023511ecf907d36e318502a95c038efc Mon Sep 17 00:00:00 2001 From: robbond Date: Wed, 25 Mar 2026 06:55:30 +0000 Subject: [PATCH] refactor(actions): adopt endpoint client in remaining document reads --- actions/services/documentDirectService.js | 79 +++++++++-------------- memory-bank/change-log.md | 31 +++++++++ 2 files changed, 63 insertions(+), 47 deletions(-) diff --git a/actions/services/documentDirectService.js b/actions/services/documentDirectService.js index dd7739ee..c772baf9 100644 --- a/actions/services/documentDirectService.js +++ b/actions/services/documentDirectService.js @@ -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 = ( diff --git a/memory-bank/change-log.md b/memory-bank/change-log.md index 655883f6..b2cdea84 100644 --- a/memory-bank/change-log.md +++ b/memory-bank/change-log.md @@ -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.