test(actions): phase 6 add parity and behavioural service hardening checks

This commit is contained in:
2026-03-13 10:11:33 +00:00
parent a35f2990c6
commit b5ae6c271f
9 changed files with 461 additions and 178 deletions
+4 -27
View File
@@ -1,14 +1,13 @@
import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import { logAndReturnResponse } from "./httpServiceUtils";
export const getNewAppeals = async (searchString) => {
try {
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
return res.data;
} catch (error) {
consoleLogger(error);
return error.response;
return logAndReturnResponse(error);
}
};
@@ -35,10 +34,7 @@ export const getNewAppealsPage = async (
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getNewDocumentsPaged = async (
@@ -50,22 +46,6 @@ export const getNewDocumentsPaged = async (
documentOrigin,
selectedWeeks
) => {
console.log(
"/api/admin/getlatestdocuments_api?pageNumber=" +
pageNumber +
"&orderby=" +
orderBy +
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords +
"&documentType=" +
documentType +
"&numberWeeks=" +
selectedWeeks +
"&documentOrigin=" +
documentOrigin
);
return axios
.get(
"/api/admin/getlatestdocuments_api?pageNumber=" +
@@ -86,8 +66,5 @@ export const getNewDocumentsPaged = async (
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
+7 -25
View File
@@ -1,6 +1,7 @@
import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import { logAndReturnResponse } from "./httpServiceUtils";
export const getCaseMessage = (searchString) => {
return axios
@@ -8,10 +9,7 @@ export const getCaseMessage = (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getIncidentbyID = (searchString) => {
@@ -24,10 +22,7 @@ export const getIncidentbyID = (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getIsPublishedbyID = (searchString) => {
@@ -38,10 +33,7 @@ export const getIsPublishedbyID = (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getPartSavedAppeal = (searchString) => {
@@ -54,10 +46,7 @@ export const getPartSavedAppeal = (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getSIPSEvents = async (caseid) => {
@@ -66,10 +55,7 @@ export const getSIPSEvents = async (caseid) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getSIPSMedia = async (caseid) => {
@@ -78,10 +64,7 @@ export const getSIPSMedia = async (caseid) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getAppealID = (
@@ -342,7 +325,6 @@ export const getPortalModuleDetails = async (appealType, caseReference) => {
const res = await axios(config);
return res.data;
} catch (error) {
console.log("error case ref:", caseReference);
consoleLogger(error);
}
};
-11
View File
@@ -50,14 +50,6 @@ export const getRepsFromBlobProxy = async (containerName) => {
};
export const getAwaitingSubmissionFromBlobProxy = async (containerName) => {
console.log(
"///////////////////////getAwaitingSubmissionFromBlobProxy: " +
containerName,
"/api/file/getawaitingsubmissionfromblobproxy?container=" +
containerName,
"\n///////////////////////\n"
);
try {
const res = await axios.get(
BASE_URL +
@@ -163,7 +155,6 @@ export const uploadSingleFile = async (filesObj, containerID, casefolderID) => {
formData.append("casefolderID", casefolderID);
for (let i = 0; i < files.length; i++) {
console.log(files.length);
formData.append(files[i].name, files[i]);
}
@@ -219,8 +210,6 @@ export const generateRepPDF = async (
casefolderID,
options = {}
) => {
console.log("generateRepPDF function: " + formValues);
var queryUrl =
"/api/file/generatepdf" + (options.download ? "?download=true" : "");
+19
View File
@@ -0,0 +1,19 @@
import { consoleLogger } from "../core/logger";
export const buildEmptyValueErrorResponse = (error) => {
return {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
};
export const logAndReturnResponse = (error) => {
consoleLogger(error);
return error.response;
};
export const logAndReturnEmptyValueErrorResponse = (error) => {
consoleLogger(error);
return buildEmptyValueErrorResponse(error);
};
-1
View File
@@ -237,7 +237,6 @@ export const sendCaseCompleteMessage = async (
return axios(config)
.then((res) => {
console.log("sendCaseCompleteMessage: ", res.data);
return res.data;
})
.catch((error) => {
+5 -40
View File
@@ -1,53 +1,27 @@
import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import { logAndReturnEmptyValueErrorResponse } from "./httpServiceUtils";
export const getAppealsTypes = () => {
return axios
.get(BASE_URL + "/api/endpoint/getappealtypes_api")
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getProjectTypes = () => {
return axios
.get(BASE_URL + "/api/endpoint/getprojecttypes_api")
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getAppealsTypesForNewAppeal = () => {
return axios
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getLPA = () => {
@@ -56,16 +30,7 @@ export const getLPA = () => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getFormData = (whichForm) => {
+16 -74
View File
@@ -1,6 +1,10 @@
import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import {
logAndReturnResponse,
logAndReturnEmptyValueErrorResponse
} from "./httpServiceUtils";
export const getBasicSearch = (searchString) => {
return axios
@@ -12,10 +16,7 @@ export const getBasicSearch = (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getBasicDNSURLSearch = (searchString) => {
@@ -28,10 +29,7 @@ export const getBasicDNSURLSearch = (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getAddressSearchPaged = (
@@ -57,10 +55,7 @@ export const getAddressSearchPaged = (
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getBasicSearchPaged = (
@@ -86,10 +81,7 @@ export const getBasicSearchPaged = (
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getDNSCoords = () => {
@@ -98,36 +90,21 @@ export const getDNSCoords = () => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getDNSList = (searchString) => {
return axios
.get(BASE_URL + "/api/endpoint/getdnslist_api")
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getBasicDNSSearch = (searchString) => {
return axios
.get(BASE_URL + "/api/endpoint/getbasicdnssearch_api")
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getBasicDNSSearchPaged = (
@@ -148,10 +125,7 @@ export const getBasicDNSSearchPaged = (
showNumberOfRecords
)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
return error.response;
});
.catch(logAndReturnResponse);
};
export const getAdvancedSearch = (searchString) => {
@@ -162,16 +136,7 @@ export const getAdvancedSearch = (searchString) => {
JSON.stringify(searchString)
)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getAdvancedSearchPaged = (
@@ -195,16 +160,7 @@ export const getAdvancedSearchPaged = (
showNumberOfRecords
)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getBasicSearchDetails = async (
@@ -247,7 +203,7 @@ export const getBasicPartSavedDetails = (
)
.then((res) => res.data)
.catch((error) => {
console.log("this error", error);
consoleLogger(error);
});
};
@@ -259,8 +215,6 @@ export const getBasicSearchDetailsPaged = async (
) => {
if (!incidentIDs || incidentIDs.length === 0) return [];
console.log("=======", primaryIdAttribute);
const filter = incidentIDs
.map((id) => {
const suffix =
@@ -276,10 +230,6 @@ export const getBasicSearchDetailsPaged = async (
filter
)}`;
console.log(
`Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
);
try {
const res = await axios.get(url);
return res.data.value || [];
@@ -372,13 +322,5 @@ export const getAddressSearch = async (searchString) => {
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText
};
return ErrResponse;
});
.catch(logAndReturnEmptyValueErrorResponse);
};