add api_root and removed token calls from methods
This commit is contained in:
+37
-89
@@ -121,16 +121,14 @@ export const getBasicSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getbasicsearch_api?token=" +
|
"api/endpoint/getbasicsearch_api?searchString=" +
|
||||||
token +
|
searchString
|
||||||
"&searchString=" +
|
|
||||||
searchString,
|
|
||||||
azureHeadersPaged(token)
|
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res.data;
|
return res.data;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
return error.response;
|
return error.response;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -157,10 +155,7 @@ export const getBasicDNSSearch = (token, searchString) => {
|
|||||||
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(BASE_URL + "/api/endpoint/getbasicdnssearch_api")
|
||||||
BASE_URL + "/api/endpoint/getbasicdnssearch_api?token=" + token,
|
|
||||||
azureHeadersPaged(token)
|
|
||||||
)
|
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
return error.response;
|
return error.response;
|
||||||
@@ -182,11 +177,8 @@ export const getAdvancedSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getadvancedsearch_api?token=" +
|
"/api/endpoint/getadvancedsearch_api?searchstring=" +
|
||||||
token +
|
JSON.stringify(searchString)
|
||||||
"&searchstring=" +
|
|
||||||
JSON.stringify(searchString),
|
|
||||||
azureHeadersPaged(token)
|
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -227,19 +219,15 @@ export const getBasicSearchDetails = (
|
|||||||
primaryIdAttribute,
|
primaryIdAttribute,
|
||||||
incidentID
|
incidentID
|
||||||
) => {
|
) => {
|
||||||
//console.log("check appealtype:", appealTypeName, caseReference);
|
|
||||||
|
|
||||||
var queryUrl =
|
|
||||||
appealTypeName +
|
|
||||||
"?$filter=_" +
|
|
||||||
primaryIdAttribute +
|
|
||||||
"s_value eq " +
|
|
||||||
incidentID +
|
|
||||||
"&$count=true";
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
BASE_URL +
|
||||||
azureHeadersPaged(token)
|
"/api/endpoint/getbasicsearchdetails_api?appealTypeName=" +
|
||||||
|
appealTypeName +
|
||||||
|
"&primaryIdAttribute=" +
|
||||||
|
primaryIdAttribute +
|
||||||
|
"&incidentID=" +
|
||||||
|
incidentID
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -297,20 +285,17 @@ export const getSearchDocumentDetailsPaged = (incidentID, pageNumber) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchDocumentHistory = (documentID) => {
|
export const getSearchDocumentHistory = (documentID) => {
|
||||||
return (
|
return axios
|
||||||
axios
|
.get(
|
||||||
//.get(queryUrl + hashAPIPath(queryUrl))
|
"/api/endpoint/getsearchdocumenthistory_api?documentid=" +
|
||||||
.get(
|
documentID
|
||||||
"/api/endpoint/getsearchdocumenthistory_api?documentid=" +
|
)
|
||||||
documentID
|
.then((res) => {
|
||||||
)
|
return res.data;
|
||||||
.then((res) => {
|
})
|
||||||
return res.data;
|
.catch((error) => {
|
||||||
})
|
console.log("thiserror", error);
|
||||||
.catch((error) => {
|
});
|
||||||
console.log("thiserror", error);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchDocumentHistoryPaged = (documentID, pageNumber) => {
|
export const getSearchDocumentHistoryPaged = (documentID, pageNumber) => {
|
||||||
@@ -350,10 +335,7 @@ export const getLinkedCases = (parentIncidentid) => {
|
|||||||
|
|
||||||
export const getAppealsTypes = (token) => {
|
export const getAppealsTypes = (token) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(BASE_URL + "/api/endpoint/getappealtypes_api")
|
||||||
BASE_URL + "/api/endpoint/getappealtypes_api?token=" + token,
|
|
||||||
azureHeaders(token)
|
|
||||||
)
|
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -369,10 +351,7 @@ export const getAppealsTypes = (token) => {
|
|||||||
|
|
||||||
export const getLPA = (token) => {
|
export const getLPA = (token) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(BASE_URL + "/api/endpoint/getlpa_api")
|
||||||
BASE_URL + "/api/endpoint/getlpa_api?token=" + token,
|
|
||||||
azureHeaders(token)
|
|
||||||
)
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
//console.log(res.data);
|
//console.log(res.data);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -391,12 +370,8 @@ export const getLPA = (token) => {
|
|||||||
// iteration 2 methods
|
// iteration 2 methods
|
||||||
|
|
||||||
export const getFormData = (token, whichForm) => {
|
export const getFormData = (token, whichForm) => {
|
||||||
var queryUrl =
|
|
||||||
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode eq 'pinswg_" +
|
|
||||||
whichForm +
|
|
||||||
"' and type eq 2)&$count=true&$top=201";
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get("/api/endpoint/getformdata_api?whichForm=" + whichForm)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("thiserror", error);
|
console.log("thiserror", error);
|
||||||
@@ -404,12 +379,8 @@ export const getFormData = (token, whichForm) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getMandatoryFields = (token, whichForm) => {
|
export const getMandatoryFields = (token, whichForm) => {
|
||||||
var queryUrl =
|
|
||||||
"EntityDefinitions(LogicalName='pinswg_" +
|
|
||||||
whichForm +
|
|
||||||
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel";
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get("/api/endpoint/getmandatoryfields_api?whichForm=" + whichForm)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("thiserror", error);
|
console.log("thiserror", error);
|
||||||
@@ -417,12 +388,8 @@ export const getMandatoryFields = (token, whichForm) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getPickLists = (token, whichForm) => {
|
export const getPickLists = (token, whichForm) => {
|
||||||
var queryUrl =
|
|
||||||
"EntityDefinitions(LogicalName='pinswg_" +
|
|
||||||
whichForm +
|
|
||||||
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true";
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get("/api/endpoint/getpicklists_api?whichForm=" + whichForm)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("thiserror", error);
|
console.log("thiserror", error);
|
||||||
@@ -430,13 +397,8 @@ export const getPickLists = (token, whichForm) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getPersonalAccount = (token, contactid) => {
|
export const getPersonalAccount = (token, contactid) => {
|
||||||
var queryUrl =
|
|
||||||
"contacts(" +
|
|
||||||
contactid +
|
|
||||||
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode&$count=true";
|
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get("/api/endpoint/getpersonalaccount_api?contactid=" + contactid)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -529,9 +491,7 @@ export const getMyCases = (token, loggedInUserId) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getmycases_api?token=" +
|
"/api/endpoint/getmycases_api?loggedInUserId=" +
|
||||||
token +
|
|
||||||
"&loggedInUserId=" +
|
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -546,9 +506,7 @@ export const getMyRepresentations = (token, loggedInUserId) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getmyrepresentations_api?token=" +
|
"/api/endpoint/getmyrepresentations_api?loggedInUserId=" +
|
||||||
token +
|
|
||||||
"&loggedInUserId=" +
|
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -561,9 +519,7 @@ export const getMyRepresentationsProxy = (token, loggedInUserId) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getmyrepresentationsproxy_api?token=" +
|
"/api/endpoint/getmyrepresentationsproxy_api?loggedInUserId=" +
|
||||||
token +
|
|
||||||
"&loggedInUserId=" +
|
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -586,9 +542,7 @@ export const getRepresentationsProxy = (token, incidentID) => {
|
|||||||
.get(queryUrl + hashAPIPath(queryUrl))
|
.get(queryUrl + hashAPIPath(queryUrl))
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getrepresentationsproxy_api?token=" +
|
"/api/endpoint/getrepresentationsproxy_api?incidentID=" +
|
||||||
token +
|
|
||||||
"&incidentID=" +
|
|
||||||
incidentID
|
incidentID
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -601,9 +555,7 @@ export const getWatchedCases = (token, loggedInUserId) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getwatchedcases_api?token=" +
|
"/api/endpoint/getwatchedcases_api?loggedInUserId=" +
|
||||||
token +
|
|
||||||
"&loggedInUserId=" +
|
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -616,9 +568,7 @@ export const getWatchedCasesProxy = (token, loggedInUserId) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getwatchedcasesproxy_api?token=" +
|
"/api/endpoint/getwatchedcasesproxy_api?loggedInUserId=" +
|
||||||
token +
|
|
||||||
"&loggedInUserId=" +
|
|
||||||
loggedInUserId
|
loggedInUserId
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -642,9 +592,7 @@ export const getPortalModuleDetails = (token, appealType, caseReference) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/endpoint/getportalmoduledetails_api?token=" +
|
"/api/endpoint/getportalmoduledetails_api?appealType=" +
|
||||||
token +
|
|
||||||
"&appealType=" +
|
|
||||||
appealType +
|
appealType +
|
||||||
"&caseReference=" +
|
"&caseReference=" +
|
||||||
caseReference
|
caseReference
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ const DNSSearchResults = (props) => {
|
|||||||
|
|
||||||
getBasicDNSSearchPaged(pageNumber)
|
getBasicDNSSearchPaged(pageNumber)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data);
|
|
||||||
setSearchResults(data);
|
setSearchResults(data);
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -90,3 +90,21 @@ export const getSearchDetailsPaged = (searchResultsObj) => {
|
|||||||
// console.log(detailsArr);
|
// console.log(detailsArr);
|
||||||
return Promise.all(detailsArr);
|
return Promise.all(detailsArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// export const absoluteUrl = (req, setLocalhost) => {
|
||||||
|
// var protocol = "https:";
|
||||||
|
// var host = req
|
||||||
|
// ? req.headers["x-forwarded-host"] || req.headers["host"]
|
||||||
|
// : window.location.host;
|
||||||
|
|
||||||
|
// if (host.indexOf("localhost") > -1) {
|
||||||
|
// if (setLocalhost) host = setLocalhost;
|
||||||
|
// protocol = "http:";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// protocol: protocol,
|
||||||
|
// host: host,
|
||||||
|
// origin: protocol + "//" + host,
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var searchString = req.query.searchstring;
|
var searchString = req.query.searchstring;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
searchString = JSON.parse(searchString);
|
searchString = JSON.parse(searchString);
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -18,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
//return "&hash=" + hashlink;
|
//return "&hash=" + hashlink;
|
||||||
|
|
||||||
return (hashPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
@@ -69,6 +70,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
azureHeadersPaged(token.access_token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
const WEBAPI_URL =
|
const WEBAPI_URL =
|
||||||
@@ -34,7 +34,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token.access_token)
|
azureHeaders(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
|
|||||||
@@ -21,13 +21,16 @@ const hashAPIPath = (queryPath) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeaders, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
@@ -22,17 +22,15 @@ const hashAPIPath = (queryPath) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var caseReference = req.query.caseReference;
|
var caseReference = req.query.caseReference;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_dnses?$filter=pinswg_name eq '" +
|
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
@@ -32,7 +32,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token)
|
azureHeaders(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -36,7 +37,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
azureHeadersPaged(token.access_token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
res.status(400).json(err);
|
res.status(400).json(err);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -31,15 +32,17 @@ export default async function ApiProxy(req, res) {
|
|||||||
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||||
: "");
|
: "");
|
||||||
|
|
||||||
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token.access_token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
res.status(400).json(err);
|
res.status(400).json(err);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var searchString = req.query.searchString;
|
var searchString = req.query.searchString;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" +
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" +
|
||||||
@@ -34,7 +34,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
const WEBAPI_URL =
|
const WEBAPI_URL =
|
||||||
@@ -24,7 +24,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
var appealTypeName = req.query.appealTypeName;
|
var appealTypeName = req.query.appealTypeName;
|
||||||
var primaryIdAttribute = req.query.primaryIdAttribute;
|
var primaryIdAttribute = req.query.primaryIdAttribute;
|
||||||
var incidentID = req.query.incidentID;
|
var incidentID = req.query.incidentID;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
appealTypeName +
|
appealTypeName +
|
||||||
@@ -37,7 +37,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
azureHeadersPaged(token)
|
azureHeaders(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -41,7 +42,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
azureHeadersPaged(token.access_token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
res.status(400).json(err);
|
res.status(400).json(err);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -40,7 +41,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
azureHeadersPaged(token.access_token)
|
azureHeadersPaged(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
res.status(400).json(err);
|
res.status(400).json(err);
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import https from "https";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged, azureHeaders } from "../../../actions";
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
//return "&hash=" + hashlink;
|
||||||
|
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var whichForm = req.query.whichForm;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode eq 'pinswg_" +
|
||||||
|
whichForm +
|
||||||
|
"' and type eq 2)&$count=true&$top=201";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -21,13 +21,16 @@ const hashAPIPath = (queryPath) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import https from "https";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged, azureHeaders } from "../../../actions";
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
//return "&hash=" + hashlink;
|
||||||
|
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var whichForm = req.query.whichForm;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"EntityDefinitions(LogicalName='pinswg_" +
|
||||||
|
whichForm +
|
||||||
|
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var loggedInUserId = req.query.loggedInUserId;
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3";
|
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var loggedInUserId = req.query.loggedInUserId;
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var loggedInUserId = req.query.loggedInUserId;
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var contactid = req.query.contactid;
|
var contactid = req.query.contactid;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"contacts(" +
|
"contacts(" +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode&$count=true";
|
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode&$count=true";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import https from "https";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var whichForm = req.query.whichForm;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"EntityDefinitions(LogicalName='pinswg_" +
|
||||||
|
whichForm +
|
||||||
|
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var appealType = req.query.appealType;
|
var appealType = req.query.appealType;
|
||||||
var caseReference = req.query.caseReference;
|
var caseReference = req.query.caseReference;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
appealType +
|
appealType +
|
||||||
@@ -29,7 +29,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
"'&$count=true";
|
"'&$count=true";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var incidentID = req.query.incidentID;
|
var incidentID = req.query.incidentID;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -54,7 +55,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
element.pinswg_isharedocumentreference
|
element.pinswg_isharedocumentreference
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
//console.log("details data:", data);
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
@@ -58,8 +59,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
element.pinswg_isharedocumentreference
|
element.pinswg_isharedocumentreference
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
//console.log("details paged data:", data);
|
var dataStr;
|
||||||
res.status(200).json(data);
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
res.status(400).json(err);
|
res.status(400).json(err);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var loggedInUserId = req.query.loggedInUserId;
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var loggedInUserId = req.query.loggedInUserId;
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
var token = req.query.token;
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
|
|||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user