diff --git a/actions/services/caseDirectService.js b/actions/services/caseDirectService.js index 3b03a061..47d53138 100644 --- a/actions/services/caseDirectService.js +++ b/actions/services/caseDirectService.js @@ -1,4 +1,3 @@ -import axios from "axios"; import { BASE_URL } from "../core/env"; import { consoleLogger } from "../core/logger"; import { logAndReturnResponse } from "./httpServiceUtils"; @@ -49,17 +48,16 @@ export const getAppealID = ( updateFormCollection, primaryAttribute ) => { - return axios - .get( - "/api/endpoint/getappealid_api?updateFormCollection=" + - updateFormCollection + - "&primaryAttribute=" + - primaryAttribute + - "&caseReference=" + - caseReference - ) - .then((res) => { - const result = Object.entries(res.data.value[0]).filter( + return getJson( + "/api/endpoint/getappealid_api?updateFormCollection=" + + updateFormCollection + + "&primaryAttribute=" + + primaryAttribute + + "&caseReference=" + + caseReference + ) + .then((data) => { + const result = Object.entries(data.value[0]).filter( ([key]) => !key.startsWith("_") )[0][1]; var appealID = result; @@ -204,18 +202,9 @@ export const updateCaseBlob = async ( export const patchCase = async (incidentid) => { var queryUrl = "/api/endpoint/patchcase_api?incidentid=" + incidentid; - var config = { - method: "get", - url: queryUrl - }; - - return axios(config) - .then((res) => { - return res.data; - }) - .catch((error) => { - //console.log("this error:", error); - }); + return getJson(queryUrl).catch((error) => { + //console.log("this error:", error); + }); }; export const getCase = (incidentID) => { diff --git a/memory-bank/change-log.md b/memory-bank/change-log.md index 2f5ee36a..28f279a0 100644 --- a/memory-bank/change-log.md +++ b/memory-bank/change-log.md @@ -1830,3 +1830,33 @@ Validation: Follow-ups: - Optional next bounded slice: assess `patchCase` and `getAppealID` for migration opportunities (if/when preserving their specific behavior contracts remains straightforward). + +--- + +### CL-051: TASK22260 next slice — case direct service final axios dependency removal + +date: 2026-03-25 +author: Cline +scope: `actions/services/caseDirectService.js` +type: change +rationale: Complete the bounded case service migration by replacing the remaining direct axios usage (`getAppealID`, `patchCase`) with shared endpoint client reads, enabling removal of the direct axios import. +impact: Finalizes endpoint client consistency in case service and removes remaining direct axios dependency from this module without changing helper contracts. +status: completed + +Summary: + +- Migrated remaining direct axios-based read helpers to `getJson(...)`: + - `getAppealID` + - `patchCase` +- Preserved behavior contracts: + - `getAppealID` still extracts first non-underscore key value from returned entity and logs on failure + - `patchCase` still swallows failure (no explicit returned error contract introduced) +- Removed now-unused `axios` import from `caseDirectService`. + +Validation: + +- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors) + +Follow-ups: + +- Optional next bounded slice: review other direct service modules for any remaining legacy `axios` import usage now that case service migration is complete.