13930 Update address search for SIPS
This commit is contained in:
@@ -298,6 +298,18 @@ export default async function ApiProxy(req, res) {
|
||||
"NavigationProperty": "pinswg_PlanningObligationAppealS106Ids",
|
||||
"value": "Planning Obligation Appeal - S106",
|
||||
},
|
||||
{
|
||||
"LogicalCollectionName": "pinswg_sipses",
|
||||
"LogicalName": "pinswg_sips",
|
||||
"PrimaryIdAttribute": "pinswg_sipscase",
|
||||
"UrlName": "sips",
|
||||
"MetadataId": "8d31911b-b8ea-ef11-ab08-00224800be9c",
|
||||
"appealTypeID": "846040002",
|
||||
"tmpNav": "pinswg_sipsid",
|
||||
"NavigationProperty": "pinswg_SIPSids",
|
||||
"value": "SIPs",
|
||||
},
|
||||
|
||||
{
|
||||
"LogicalCollectionName": "pinswg_rows",
|
||||
"LogicalName": "pinswg_row",
|
||||
@@ -345,7 +357,8 @@ export default async function ApiProxy(req, res) {
|
||||
item.LogicalCollectionName == "pinswg_electricityacts" ||
|
||||
item.LogicalCollectionName ==
|
||||
"pinswg_transportandworkacts" ||
|
||||
item.LogicalCollectionName == "pinswg_dnses"
|
||||
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||
item.LogicalCollectionName == "pinswg_sipses"
|
||||
? "pinswg_addressline1"
|
||||
: "pinswg_siteaddressline1") +
|
||||
", '" +
|
||||
@@ -363,7 +376,8 @@ export default async function ApiProxy(req, res) {
|
||||
"pinswg_transportandworkacts" ||
|
||||
item.LogicalCollectionName ==
|
||||
"pinswg_electricityacts" ||
|
||||
item.LogicalCollectionName == "pinswg_dnses"
|
||||
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||
item.LogicalCollectionName == "pinswg_sipses"
|
||||
? "pinswg_addresstown"
|
||||
: "pinswg_siteaddresstown") +
|
||||
", '" +
|
||||
@@ -383,7 +397,8 @@ export default async function ApiProxy(req, res) {
|
||||
"pinswg_transportandworkacts" ||
|
||||
item.LogicalCollectionName ==
|
||||
"pinswg_electricityacts" ||
|
||||
item.LogicalCollectionName == "pinswg_dnses"
|
||||
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||
item.LogicalCollectionName == "pinswg_sipses"
|
||||
? "pinswg_addresscounty"
|
||||
: item.LogicalCollectionName == "pinswg_rows"
|
||||
? "pinswg_sitecounty"
|
||||
@@ -459,6 +474,7 @@ export default async function ApiProxy(req, res) {
|
||||
? "pinswg_addresstown,pinswg_addressline1,pinswg_addresscounty,pinswg_addressline2,pinswg_addresspostcode"
|
||||
: item.LogicalCollectionName == "pinswg_electricityacts" ||
|
||||
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||
item.LogicalCollectionName == "pinswg_sipses" ||
|
||||
item.LogicalCollectionName ==
|
||||
"pinswg_transportandworkacts"
|
||||
? "pinswg_addresstown,pinswg_addressline1,pinswg_addresscounty,pinswg_addressline2,pinswg_postcode"
|
||||
@@ -468,13 +484,14 @@ export default async function ApiProxy(req, res) {
|
||||
"," +
|
||||
(item.LogicalCollectionName == "pinswg_dnses" ||
|
||||
item.LogicalCollectionName == "pinswg_transportandworkacts"
|
||||
? "pinswg_dateofdecision"
|
||||
? "pinswg_dateofdecision,"
|
||||
: item.LogicalCollectionName == "pinswg_nonvalidations"
|
||||
? "pinswg_decisionissueddate"
|
||||
? "pinswg_decisionissueddate,"
|
||||
: item.LogicalCollectionName == "pinswg_electricityacts"
|
||||
? "pinswg_datedecision"
|
||||
: "pinswg_casedecisiondate") +
|
||||
"," +
|
||||
? "pinswg_datedecision,"
|
||||
: item.LogicalCollectionName == "pinswg_sipses"
|
||||
? ""
|
||||
: "pinswg_casedecisiondate,") +
|
||||
(item.LogicalCollectionName == "pinswg_planningappeals78s"
|
||||
? "pinswg_dicision"
|
||||
: item.LogicalCollectionName ==
|
||||
@@ -484,12 +501,14 @@ export default async function ApiProxy(req, res) {
|
||||
? "pinswg_decisionissued"
|
||||
: "pinswg_decision") +
|
||||
"," +
|
||||
(item.LogicalCollectionName == "pinswg_nonvalidations"
|
||||
(item.LogicalCollectionName == "pinswg_nonvalidations" ||
|
||||
item.LogicalCollectionName == "pinswg_sipses"
|
||||
? ""
|
||||
: "pinswg_dateeventrequested,") +
|
||||
"statuscode,_" +
|
||||
item.NavigationProperty.toLowerCase() +
|
||||
"_value" +
|
||||
"statuscode" +
|
||||
(item.LogicalCollectionName == "pinswg_sipses"
|
||||
? ""
|
||||
: ",_" + item.NavigationProperty.toLowerCase() + "_value") +
|
||||
(item.LogicalCollectionName == "pinswg_planningappeals78s"
|
||||
? ",_pinswg_localplanningauthority_value"
|
||||
: "") +
|
||||
@@ -519,19 +538,23 @@ export default async function ApiProxy(req, res) {
|
||||
item.LogicalCollectionName == "pinswg_maintenanceoflands217s" ||
|
||||
item.LogicalCollectionName ==
|
||||
"pinswg_enforcementlistedbuildingconservationaps" ||
|
||||
item.LogicalCollectionName == "pinswg_dnses"
|
||||
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||
item.LogicalCollectionName == "pinswg_sipses"
|
||||
? ",_pinswg_associatedlpa_value"
|
||||
: "");
|
||||
: "") +
|
||||
(item.LogicalCollectionName == "pinswg_sipses"
|
||||
? ",_pinswg_sipscase_value"
|
||||
: ",_" + item.PrimaryIdAttribute + "s_value");
|
||||
|
||||
console.log(
|
||||
"\n==========================================\n",
|
||||
"basic search: " + queryUrl,
|
||||
"\n\n",
|
||||
item.LogicalCollectionName,
|
||||
"\n\n",
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
"\n==========================================\n"
|
||||
);
|
||||
// console.log(
|
||||
// "\n==========================================\n",
|
||||
// "basic search: " + queryUrl,
|
||||
// "\n\n",
|
||||
// item.LogicalCollectionName,
|
||||
// "\n\n",
|
||||
// WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
// "\n==========================================\n"
|
||||
// );
|
||||
|
||||
const resultObj = axios
|
||||
.get(
|
||||
@@ -544,9 +567,11 @@ export default async function ApiProxy(req, res) {
|
||||
"pinswg_appealType": item.value,
|
||||
"incidentid":
|
||||
key[
|
||||
"_" +
|
||||
item.NavigationProperty.toLowerCase() +
|
||||
"_value"
|
||||
item.value == "SIPs"
|
||||
? "_pinswg_sipscase_value"
|
||||
: "_" +
|
||||
item.NavigationProperty.toLowerCase() +
|
||||
"_value"
|
||||
],
|
||||
});
|
||||
});
|
||||
@@ -567,6 +592,7 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
const getIncidentResultsObj = await Promise.all(
|
||||
searchResultsObj.map(async (key) => {
|
||||
console.log(key);
|
||||
var queryUrl =
|
||||
"incidents?$select=ticketnumber,pinswg_publishtoweb,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=incidentid eq " +
|
||||
key.incidentid +
|
||||
@@ -582,6 +608,11 @@ export default async function ApiProxy(req, res) {
|
||||
.then(({ data }) => {
|
||||
return data.value[0];
|
||||
});
|
||||
|
||||
console.log(
|
||||
"pinswg_publishtoweb: " + incidentObj.pinswg_publishtoweb,
|
||||
"ticketnumber: " + incidentObj.ticketnumber
|
||||
);
|
||||
Object.assign(key, {
|
||||
"pinswg_publishtoweb": incidentObj.pinswg_publishtoweb,
|
||||
"ticketnumber": incidentObj.ticketnumber,
|
||||
|
||||
Reference in New Issue
Block a user