update base url from app settings
This commit is contained in:
+8
-5
@@ -3,7 +3,9 @@ import https from "https";
|
||||
//import {XMLHttpRequest} from 'xmlhttprequest';
|
||||
|
||||
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
|
||||
let BASE_URL = "http://localhost:3000";
|
||||
|
||||
let BASE_URL;
|
||||
BASE_URL = process.env.API_ROOT || "http://localhost:3000";
|
||||
|
||||
const agent = new https.Agent({
|
||||
rejectUnauthorized: false,
|
||||
@@ -26,7 +28,7 @@ const crmHeaders = {
|
||||
|
||||
export const getBasicSearch = (searchString) => {
|
||||
console.log("got to axios", searchString);
|
||||
|
||||
console.log("api_root: ", BASE_URL);
|
||||
return (
|
||||
axios
|
||||
//.get("https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=contains(title, '" + searchString + "')&$count=true", crmHeaders)
|
||||
@@ -43,7 +45,7 @@ export const getBasicSearch = (searchString) => {
|
||||
|
||||
export const getFormData = (whichForm) => {
|
||||
console.log("got to axios", whichForm);
|
||||
|
||||
console.log("api_root: ", BASE_URL);
|
||||
return (
|
||||
axios
|
||||
//.get("api/appealforms/pinswg_dns", {
|
||||
@@ -66,7 +68,7 @@ export const getFormData = (whichForm) => {
|
||||
|
||||
export const getAppealsTypes = () => {
|
||||
console.log("got to axios: appeal types");
|
||||
|
||||
console.log("api_root: ", BASE_URL);
|
||||
return axios
|
||||
.get(BASE_URL + "/api/lookups/pinswg_appealcasetype", {
|
||||
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||
@@ -161,6 +163,7 @@ export const getBasicSearch2 = (searchString) => {
|
||||
|
||||
export const getAppealTypeDetail = (caseReference, appealcasetype) => {
|
||||
console.log("got to axios", searchString);
|
||||
console.log("api_root: ", BASE_URL);
|
||||
// example appealcasetype type pinswg_householderappealhases
|
||||
return axios
|
||||
.get(
|
||||
@@ -180,7 +183,7 @@ export const getAppealTypeDetail = (caseReference, appealcasetype) => {
|
||||
|
||||
export const getLPA = () => {
|
||||
console.log("got to axios", searchString);
|
||||
|
||||
console.log("api_root: ", BASE_URL);
|
||||
return axios
|
||||
.get(
|
||||
"https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/accounts?$select=name",
|
||||
|
||||
@@ -86,8 +86,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
// );
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
console.log("mapstate", state);
|
||||
|
||||
return {
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
|
||||
@@ -85,8 +85,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
// );
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
console.log("mapstate", state);
|
||||
|
||||
return {
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
|
||||
@@ -22,7 +22,6 @@ const combinedReducer = combineReducers({
|
||||
const reducer = (state = { progress: "{}" }, action) => {
|
||||
switch (action.type) {
|
||||
case HYDRATE:
|
||||
console.log("here", state);
|
||||
//if (action.payload.progress === '{}') delete action.payload.progress;
|
||||
return { ...state, ...action.payload };
|
||||
case "SERVER_ACTION":
|
||||
|
||||
Reference in New Issue
Block a user