refactor(actions): remove remaining axios usage in case service

This commit is contained in:
2026-03-25 08:03:02 +00:00
parent 9d67079fb0
commit 2f95636c4a
2 changed files with 43 additions and 24 deletions
+4 -15
View File
@@ -1,4 +1,3 @@
import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import { logAndReturnResponse } from "./httpServiceUtils";
@@ -49,8 +48,7 @@ export const getAppealID = (
updateFormCollection,
primaryAttribute
) => {
return axios
.get(
return getJson(
"/api/endpoint/getappealid_api?updateFormCollection=" +
updateFormCollection +
"&primaryAttribute=" +
@@ -58,8 +56,8 @@ export const getAppealID = (
"&caseReference=" +
caseReference
)
.then((res) => {
const result = Object.entries(res.data.value[0]).filter(
.then((data) => {
const result = Object.entries(data.value[0]).filter(
([key]) => !key.startsWith("_")
)[0][1];
var appealID = result;
@@ -204,16 +202,7 @@ 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) => {
return getJson(queryUrl).catch((error) => {
//console.log("this error:", error);
});
};
+30
View File
@@ -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.