test(actions): phase 6 add parity and behavioural service hardening checks
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user