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
+13 -24
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,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) => {