hardeing changes and UAT tweaks
This commit is contained in:
+141
-147
@@ -2,10 +2,7 @@ import axios from "axios";
|
||||
import https from "https";
|
||||
import CryptoJS from "crypto-js";
|
||||
import HmacSHA256 from "crypto-js/hmac-sha256";
|
||||
|
||||
//import {XMLHttpRequest} from 'xmlhttprequest';
|
||||
|
||||
//process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
|
||||
import { has, indexOf } from "lodash";
|
||||
|
||||
let BASE_URL;
|
||||
const port = parseInt(process.env.PORT, 10) || 3000;
|
||||
@@ -105,12 +102,17 @@ const azureHeadersPaged = (SASToken) => {
|
||||
};
|
||||
};
|
||||
|
||||
const hashProxyPath = (queryPath) => {
|
||||
const hashAPIPath = (queryPath) => {
|
||||
var hashPath =
|
||||
queryPath.indexOf("/api/proxy/") == -1
|
||||
? queryPath
|
||||
: queryPath.split("/api/proxy/")[1];
|
||||
|
||||
var hashlink = CryptoJS.HmacSHA256(
|
||||
queryPath,
|
||||
hashPath,
|
||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||
);
|
||||
hashlink = hashlink.toString();
|
||||
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||
|
||||
return "&hash=" + hashlink;
|
||||
};
|
||||
@@ -118,26 +120,22 @@ const hashProxyPath = (queryPath) => {
|
||||
export const getBasicSearch = (token, searchString) => {
|
||||
//console.log("\n\n", token, searchString);
|
||||
|
||||
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, '" +
|
||||
searchString +
|
||||
"') or contains(ticketnumber, '" +
|
||||
searchString +
|
||||
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"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, '" +
|
||||
searchString +
|
||||
"') or contains(ticketnumber, '" +
|
||||
searchString +
|
||||
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => {
|
||||
// console.log(" ");
|
||||
// console.log("/////////////////////");
|
||||
// console.log("data:" + res.data.value);
|
||||
// console.log("/////////////////////");
|
||||
// console.log(" ");
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log("thiserror", error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -159,7 +157,7 @@ export const getBasicSearchPaged = (searchString, pageNumber) => {
|
||||
|
||||
//console.log(queryUrl);
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => {
|
||||
// console.log(" ");
|
||||
// console.log("/////////////////////");
|
||||
@@ -175,10 +173,12 @@ export const getBasicSearchPaged = (searchString, pageNumber) => {
|
||||
};
|
||||
|
||||
export const getBasicDNSSearch = (token, searchString) => {
|
||||
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";
|
||||
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"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",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -197,7 +197,7 @@ export const getBasicDNSSearchPaged = (pageNumber) => {
|
||||
: "");
|
||||
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
return error.response;
|
||||
@@ -234,12 +234,13 @@ export const getAdvancedSearch = (token, searchString) => {
|
||||
searchString.apt
|
||||
: "";
|
||||
|
||||
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=" +
|
||||
queryString +
|
||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||
queryString +
|
||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -294,7 +295,7 @@ export const getAdvancedSearchPaged = (searchString, pageNumber) => {
|
||||
: "");
|
||||
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
let ErrResponse = {
|
||||
@@ -314,15 +315,17 @@ export const getBasicSearchDetails = (
|
||||
incidentID
|
||||
) => {
|
||||
//console.log("check appealtype:", appealType, caseReference);
|
||||
|
||||
var queryUrl =
|
||||
appealTypeName +
|
||||
"?$filter=_" +
|
||||
primaryIdAttribute +
|
||||
"s_value eq " +
|
||||
incidentID +
|
||||
"&$count=true";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
appealTypeName +
|
||||
"?$filter=_" +
|
||||
primaryIdAttribute +
|
||||
"s_value eq " +
|
||||
incidentID +
|
||||
"&$count=true",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -349,7 +352,7 @@ export const getBasicSearchDetailsPaged = (
|
||||
"&$count=true";
|
||||
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this error", error);
|
||||
@@ -358,12 +361,13 @@ export const getBasicSearchDetailsPaged = (
|
||||
|
||||
export const getSearchDocumentDetails = (token, incidentID) => {
|
||||
console.log(incidentID);
|
||||
var queryUrl =
|
||||
"pinswg_documents?$count=true&$filter=_pinswg_documentids_value eq " +
|
||||
incidentID +
|
||||
" and pinswg_publishtoweb eq true&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"pinswg_documents?$count=true&$filter=_pinswg_documentids_value eq " +
|
||||
incidentID +
|
||||
" and pinswg_publishtoweb eq true&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -373,11 +377,12 @@ export const getSearchDocumentDetails = (token, incidentID) => {
|
||||
};
|
||||
|
||||
export const getSearchDocumentHistory = (token, documentID) => {
|
||||
var queryUrl =
|
||||
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||
documentID;
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||
documentID,
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -400,7 +405,7 @@ export const getSearchDocumentDetailsPaged = (incidentID, pageNumber) => {
|
||||
: "");
|
||||
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -417,7 +422,7 @@ export const getSearchDocumentHistoryPaged = (documentID, pageNumber) => {
|
||||
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||
: "");
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -432,7 +437,7 @@ export const getSearchDocumentDetails1 = (incidentID) => {
|
||||
incidentID +
|
||||
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -450,7 +455,7 @@ export const getSearchDocumentDetails1Paged = (incidentID, pageNumber) => {
|
||||
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||
: "");
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -464,7 +469,7 @@ export const getSearchDocumentHistory1 = (documentID) => {
|
||||
"/api/proxy/pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||
documentID;
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
@@ -483,7 +488,7 @@ export const getSearchDocumentHistory1Paged = (documentID, pageNumber) => {
|
||||
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||
: "");
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
@@ -493,12 +498,13 @@ export const getSearchDocumentHistory1Paged = (documentID, pageNumber) => {
|
||||
};
|
||||
|
||||
export const getBasicDNSSearchDetails = (token, appealType, caseReference) => {
|
||||
var queryUrl =
|
||||
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||
caseReference +
|
||||
"'&$count=true";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||
caseReference +
|
||||
"'&$count=true",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -516,7 +522,7 @@ export const getBasicDNSSearchDetailsPaged = (caseReference) => {
|
||||
"'&$count=true";
|
||||
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -530,7 +536,7 @@ export const getLinkedCases = (parentIncidentid) => {
|
||||
parentIncidentid +
|
||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true &$select=title, incidentid";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => {
|
||||
//console.log(" linked date", res.data);
|
||||
return res.data;
|
||||
@@ -541,16 +547,12 @@ export const getLinkedCases = (parentIncidentid) => {
|
||||
};
|
||||
|
||||
export const getFormData = (token, whichForm) => {
|
||||
//console.log("got to axios", whichForm);
|
||||
//console.log("api_root: ", BASE_URL);
|
||||
var queryUrl =
|
||||
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode%20eq%20%27pinswg_" +
|
||||
whichForm +
|
||||
"%27and%20type%20eq%202)&$count=true&$top=201";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode%20eq%20%27pinswg_" +
|
||||
whichForm +
|
||||
"%27and%20type%20eq%202)&$count=true&$top=201",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -558,14 +560,12 @@ export const getFormData = (token, whichForm) => {
|
||||
};
|
||||
|
||||
export const getMandatoryFields = (token, whichForm) => {
|
||||
var queryUrl =
|
||||
"EntityDefinitions(LogicalName='pinswg_" +
|
||||
whichForm +
|
||||
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"EntityDefinitions(LogicalName='pinswg_" +
|
||||
whichForm +
|
||||
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -573,14 +573,12 @@ export const getMandatoryFields = (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
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"EntityDefinitions(LogicalName='pinswg_" +
|
||||
whichForm +
|
||||
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -588,12 +586,10 @@ export const getPickLists = (token, whichForm) => {
|
||||
};
|
||||
|
||||
export const getAppealsTypes = (token) => {
|
||||
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";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"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",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
@@ -609,12 +605,10 @@ export const getAppealsTypes = (token) => {
|
||||
|
||||
export const getLPA = (token) => {
|
||||
// console.log("api_root: ", BASE_URL);
|
||||
var queryUrl =
|
||||
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => {
|
||||
//console.log(res.data);
|
||||
return res.data;
|
||||
@@ -631,15 +625,13 @@ export const getLPA = (token) => {
|
||||
};
|
||||
|
||||
export const getPersonalAccount = (token, contactid) => {
|
||||
//console.log("getting personal details:", 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
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"contacts(" +
|
||||
contactid +
|
||||
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode&$count=true",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
return res.data;
|
||||
@@ -660,7 +652,7 @@ export const getAppealID = (
|
||||
updateFormCollection,
|
||||
primaryAttribute
|
||||
) => {
|
||||
const weburl =
|
||||
const queryUrl =
|
||||
"/api/proxy/" +
|
||||
updateFormCollection +
|
||||
"?$count=true&$select=_" +
|
||||
@@ -669,9 +661,12 @@ export const getAppealID = (
|
||||
caseReference +
|
||||
"'";
|
||||
|
||||
console.log("proxy url ", weburl);
|
||||
console.log("proxy url ", queryUrl);
|
||||
return axios
|
||||
.get(weburl, azureHeaders(getSASToken()))
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeaders(getSASToken())
|
||||
)
|
||||
.then((res) => {
|
||||
var appealID = res.data.value[0][primaryAttribute];
|
||||
return appealID;
|
||||
@@ -690,7 +685,7 @@ export const getLogin = (emailAddress, pwd) => {
|
||||
"'&$count=true&$select=emailaddress1,%20contactid,pinswg_custom_password, yomifullname, firstname, lastname";
|
||||
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -699,6 +694,8 @@ export const getLogin = (emailAddress, pwd) => {
|
||||
|
||||
export const createCase = (token, appealTypeId, lpaID, contactid) => {
|
||||
appealTypeId = parseInt(appealTypeId);
|
||||
|
||||
var queryUrl = "incidents";
|
||||
var data = JSON.stringify({
|
||||
"title": "insertion test case",
|
||||
"caseorigincode": 3,
|
||||
@@ -709,7 +706,7 @@ export const createCase = (token, appealTypeId, lpaID, contactid) => {
|
||||
|
||||
var config = {
|
||||
method: "post",
|
||||
url: WEBAPI_URL + "incidents",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -748,10 +745,11 @@ export const updateCase = async (
|
||||
|
||||
console.log("appeal obj ", appealObj);
|
||||
|
||||
var queryUrl = "/api/proxy/" + updateFormCollection + "(" + appealObj + ")";
|
||||
var config = {
|
||||
method: "patch",
|
||||
//url: WEBAPI_URL + updateFormCollection + "(" + incidentId + ")",
|
||||
url: "/api/proxy/" + updateFormCollection + "(" + appealObj + ")",
|
||||
//url: updateFormCollection + "(" + incidentId + ")",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -776,14 +774,12 @@ export const updateCase = async (
|
||||
|
||||
export const getMyCases = (token, loggedInUserId) => {
|
||||
//console.log("in action ", loggedInUserId);
|
||||
var queryUrl =
|
||||
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
||||
loggedInUserId +
|
||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
||||
loggedInUserId +
|
||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
@@ -793,14 +789,12 @@ export const getMyCases = (token, loggedInUserId) => {
|
||||
};
|
||||
|
||||
export const getMyRepresentations = (token, loggedInUserId) => {
|
||||
var queryUrl =
|
||||
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||
loggedInUserId +
|
||||
"&$count=true&$orderby=createdon desc";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||
loggedInUserId +
|
||||
"&$count=true&$orderby=createdon desc",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
@@ -813,7 +807,7 @@ export const getMyRepresentationsProxy = (token, loggedInUserId) => {
|
||||
loggedInUserId +
|
||||
"&$count=true&$orderby=createdon desc";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
@@ -821,9 +815,11 @@ export const getMyRepresentationsProxy = (token, loggedInUserId) => {
|
||||
};
|
||||
|
||||
export const deleteMyRepresentations = (myRepresentationsID) => {
|
||||
var queryUrl =
|
||||
"/api/proxy/pinswg_representationses(" + myRepresentationsID + ")";
|
||||
var config = {
|
||||
method: "delete",
|
||||
url: "/api/proxy/pinswg_representationses(" + myRepresentationsID + ")",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -850,7 +846,7 @@ export const getRepresentations = (incidentID) => {
|
||||
incidentID +
|
||||
" and pinswg_publishtoweb eq true&$count=true&$orderby=createdon desc";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
@@ -863,7 +859,7 @@ export const getRepresentationsProxy = (token, incidentID) => {
|
||||
incidentID +
|
||||
"&$count=true&$orderby=createdon desc";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
@@ -871,14 +867,12 @@ export const getRepresentationsProxy = (token, incidentID) => {
|
||||
};
|
||||
|
||||
export const getWatchedCases = (token, loggedInUserId) => {
|
||||
var queryUrl =
|
||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||
loggedInUserId +
|
||||
"&$count=true&$orderby=createdon desc";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||
loggedInUserId +
|
||||
"&$count=true&$orderby=createdon desc",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
@@ -891,7 +885,7 @@ export const getWatchedCasesProxy = (token, loggedInUserId) => {
|
||||
loggedInUserId +
|
||||
"&$count=true&$orderby=createdon desc";
|
||||
return axios
|
||||
.get(queryUrl | +hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
@@ -900,10 +894,11 @@ export const getWatchedCasesProxy = (token, loggedInUserId) => {
|
||||
|
||||
export const createWatchedCases = (formValues) => {
|
||||
var data = JSON.stringify(formValues);
|
||||
var queryUrl = "/api/proxy/pinswg_watchlists";
|
||||
|
||||
var config = {
|
||||
method: "post",
|
||||
url: "/api/proxy/pinswg_watchlists",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -926,9 +921,10 @@ export const createWatchedCases = (formValues) => {
|
||||
};
|
||||
|
||||
export const deleteWatchedCases = (watchedCaseID) => {
|
||||
var queryUrl = "/api/proxy/pinswg_watchlists(" + watchedCaseID + ")";
|
||||
var config = {
|
||||
method: "delete",
|
||||
url: "/api/proxy/pinswg_watchlists(" + watchedCaseID + ")",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -961,15 +957,13 @@ export const getAwaitingSubmission = (token) => {
|
||||
};
|
||||
|
||||
export const getPortalModuleDetails = (token, appealType, caseReference) => {
|
||||
var queryUrl =
|
||||
appealType +
|
||||
"?$filter=pinswg_name eq '" +
|
||||
caseReference +
|
||||
"'&$count=true";
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
appealType +
|
||||
"?$filter=pinswg_name eq '" +
|
||||
caseReference +
|
||||
"'&$count=true",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -988,7 +982,7 @@ export const getPortalModuleDetailsProxy = (
|
||||
caseReference +
|
||||
"'&$count=true";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -1002,7 +996,7 @@ export const getEmailAccountCheck = (emailAddress) => {
|
||||
emailAddress +
|
||||
"'&$count=true&$select=emailaddress1, contactid";
|
||||
return axios
|
||||
.get(queryUrl + hashProxyPath(queryUrl))
|
||||
.get(queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("thiserror", error);
|
||||
@@ -1011,10 +1005,10 @@ export const getEmailAccountCheck = (emailAddress) => {
|
||||
|
||||
export const createAccount = (formValues) => {
|
||||
var data = JSON.stringify(formValues);
|
||||
|
||||
var queryUrl = "/api/proxy/contacts";
|
||||
var config = {
|
||||
method: "post",
|
||||
url: "/api/proxy/contacts",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -1038,10 +1032,10 @@ export const createAccount = (formValues) => {
|
||||
|
||||
export const updateAccount = (contactId, updateBody) => {
|
||||
var data = JSON.stringify(updateBody);
|
||||
|
||||
var queryUrl = "/api/proxy/contacts(" + contactId + ")";
|
||||
var config = {
|
||||
method: "patch",
|
||||
url: "/api/proxy/contacts(" + contactId + ")",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
@@ -1066,10 +1060,10 @@ export const updateAccount = (contactId, updateBody) => {
|
||||
export const updatePassword = (contactId, newpassword) => {
|
||||
let updateBody = { "pinswg_custom_password": newpassword };
|
||||
var data = JSON.stringify(updateBody);
|
||||
|
||||
var queryUrl = "/api/proxy/contacts(" + contactId + ")";
|
||||
var config = {
|
||||
method: "patch",
|
||||
url: "/api/proxy/contacts(" + contactId + ")",
|
||||
url: queryUrl + hashAPIPath(queryUrl),
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
|
||||
Reference in New Issue
Block a user