mehods to call address search apis

This commit is contained in:
2024-04-22 13:10:03 +01:00
parent 38f373864e
commit 147299ba78
+83
View File
@@ -1,5 +1,6 @@
import axios from "axios";
import CryptoJS from "crypto-js";
import { createModuleResolutionCache } from "typescript";
let BASE_URL;
const port = parseInt(process.env.PORT, 10) || 3000;
@@ -198,6 +199,36 @@ export const getBasicSearch = (searchString) => {
});
};
export const getIncidentbyID = (searchString) => {
return axios
.get(
BASE_URL +
"/api/endpoint/getincidentbyid_api?searchString=" +
searchString
)
.then((res) => {
return res.data;
})
.catch((error) => {
//console.log(error);
return error.response;
});
};
export const getIsPublishedbyID = (searchString) => {
return axios
.get(
"/api/endpoint/getispublishedbyid_api?searchString=" + searchString
)
.then((res) => {
return res.data;
})
.catch((error) => {
//console.log(error);
return error.response;
});
};
export const getPartSavedAppeal = (searchString) => {
return axios
.get(
@@ -230,6 +261,35 @@ export const getBasicDNSURLSearch = (searchString) => {
});
};
export const getAddressSearchPaged = (
searchString,
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
) => {
//console.log(queryUrl);
return axios
.get(
"/api/endpoint/getbasicsearch_by_address_paged_api?searchString=" +
searchString +
"&pageNumber=" +
pageNumber +
"&orderby=" +
orderBy +
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
)
.then((res) => {
return res.data;
})
.catch((error) => {
return error.response;
});
};
export const getBasicSearchPaged = (
searchString,
pageNumber,
@@ -1732,3 +1792,26 @@ export const sendRepCompleteMessage = async (containerID, caseReference) => {
consoleLogger(error);
});
};
export const getAddressSearch = async (searchString) => {
const params = new URLSearchParams(searchString);
const str = params.toString();
console.log(
"the url",
BASE_URL + "/api/endpoint/getbasicsearch_by_address_api?" + str
);
try {
const res = await axios.get(
BASE_URL + "/api/endpoint/getbasicsearch_by_address_api?" + str
);
return res.data;
} catch (error) {
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText,
};
return ErrResponse;
}
};