diff --git a/actions/index.js b/actions/index.js index 1a043c14..33a5e58f 100644 --- a/actions/index.js +++ b/actions/index.js @@ -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; + } +};