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",
|
"NavigationProperty": "pinswg_PlanningObligationAppealS106Ids",
|
||||||
"value": "Planning Obligation Appeal - S106",
|
"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",
|
"LogicalCollectionName": "pinswg_rows",
|
||||||
"LogicalName": "pinswg_row",
|
"LogicalName": "pinswg_row",
|
||||||
@@ -345,7 +357,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
item.LogicalCollectionName == "pinswg_electricityacts" ||
|
item.LogicalCollectionName == "pinswg_electricityacts" ||
|
||||||
item.LogicalCollectionName ==
|
item.LogicalCollectionName ==
|
||||||
"pinswg_transportandworkacts" ||
|
"pinswg_transportandworkacts" ||
|
||||||
item.LogicalCollectionName == "pinswg_dnses"
|
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||||
|
item.LogicalCollectionName == "pinswg_sipses"
|
||||||
? "pinswg_addressline1"
|
? "pinswg_addressline1"
|
||||||
: "pinswg_siteaddressline1") +
|
: "pinswg_siteaddressline1") +
|
||||||
", '" +
|
", '" +
|
||||||
@@ -363,7 +376,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
"pinswg_transportandworkacts" ||
|
"pinswg_transportandworkacts" ||
|
||||||
item.LogicalCollectionName ==
|
item.LogicalCollectionName ==
|
||||||
"pinswg_electricityacts" ||
|
"pinswg_electricityacts" ||
|
||||||
item.LogicalCollectionName == "pinswg_dnses"
|
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||||
|
item.LogicalCollectionName == "pinswg_sipses"
|
||||||
? "pinswg_addresstown"
|
? "pinswg_addresstown"
|
||||||
: "pinswg_siteaddresstown") +
|
: "pinswg_siteaddresstown") +
|
||||||
", '" +
|
", '" +
|
||||||
@@ -383,7 +397,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
"pinswg_transportandworkacts" ||
|
"pinswg_transportandworkacts" ||
|
||||||
item.LogicalCollectionName ==
|
item.LogicalCollectionName ==
|
||||||
"pinswg_electricityacts" ||
|
"pinswg_electricityacts" ||
|
||||||
item.LogicalCollectionName == "pinswg_dnses"
|
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||||
|
item.LogicalCollectionName == "pinswg_sipses"
|
||||||
? "pinswg_addresscounty"
|
? "pinswg_addresscounty"
|
||||||
: item.LogicalCollectionName == "pinswg_rows"
|
: item.LogicalCollectionName == "pinswg_rows"
|
||||||
? "pinswg_sitecounty"
|
? "pinswg_sitecounty"
|
||||||
@@ -459,6 +474,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
? "pinswg_addresstown,pinswg_addressline1,pinswg_addresscounty,pinswg_addressline2,pinswg_addresspostcode"
|
? "pinswg_addresstown,pinswg_addressline1,pinswg_addresscounty,pinswg_addressline2,pinswg_addresspostcode"
|
||||||
: item.LogicalCollectionName == "pinswg_electricityacts" ||
|
: item.LogicalCollectionName == "pinswg_electricityacts" ||
|
||||||
item.LogicalCollectionName == "pinswg_dnses" ||
|
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||||
|
item.LogicalCollectionName == "pinswg_sipses" ||
|
||||||
item.LogicalCollectionName ==
|
item.LogicalCollectionName ==
|
||||||
"pinswg_transportandworkacts"
|
"pinswg_transportandworkacts"
|
||||||
? "pinswg_addresstown,pinswg_addressline1,pinswg_addresscounty,pinswg_addressline2,pinswg_postcode"
|
? "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_dnses" ||
|
||||||
item.LogicalCollectionName == "pinswg_transportandworkacts"
|
item.LogicalCollectionName == "pinswg_transportandworkacts"
|
||||||
? "pinswg_dateofdecision"
|
? "pinswg_dateofdecision,"
|
||||||
: item.LogicalCollectionName == "pinswg_nonvalidations"
|
: item.LogicalCollectionName == "pinswg_nonvalidations"
|
||||||
? "pinswg_decisionissueddate"
|
? "pinswg_decisionissueddate,"
|
||||||
: item.LogicalCollectionName == "pinswg_electricityacts"
|
: item.LogicalCollectionName == "pinswg_electricityacts"
|
||||||
? "pinswg_datedecision"
|
? "pinswg_datedecision,"
|
||||||
: "pinswg_casedecisiondate") +
|
: item.LogicalCollectionName == "pinswg_sipses"
|
||||||
"," +
|
? ""
|
||||||
|
: "pinswg_casedecisiondate,") +
|
||||||
(item.LogicalCollectionName == "pinswg_planningappeals78s"
|
(item.LogicalCollectionName == "pinswg_planningappeals78s"
|
||||||
? "pinswg_dicision"
|
? "pinswg_dicision"
|
||||||
: item.LogicalCollectionName ==
|
: item.LogicalCollectionName ==
|
||||||
@@ -484,12 +501,14 @@ export default async function ApiProxy(req, res) {
|
|||||||
? "pinswg_decisionissued"
|
? "pinswg_decisionissued"
|
||||||
: "pinswg_decision") +
|
: "pinswg_decision") +
|
||||||
"," +
|
"," +
|
||||||
(item.LogicalCollectionName == "pinswg_nonvalidations"
|
(item.LogicalCollectionName == "pinswg_nonvalidations" ||
|
||||||
|
item.LogicalCollectionName == "pinswg_sipses"
|
||||||
? ""
|
? ""
|
||||||
: "pinswg_dateeventrequested,") +
|
: "pinswg_dateeventrequested,") +
|
||||||
"statuscode,_" +
|
"statuscode" +
|
||||||
item.NavigationProperty.toLowerCase() +
|
(item.LogicalCollectionName == "pinswg_sipses"
|
||||||
"_value" +
|
? ""
|
||||||
|
: ",_" + item.NavigationProperty.toLowerCase() + "_value") +
|
||||||
(item.LogicalCollectionName == "pinswg_planningappeals78s"
|
(item.LogicalCollectionName == "pinswg_planningappeals78s"
|
||||||
? ",_pinswg_localplanningauthority_value"
|
? ",_pinswg_localplanningauthority_value"
|
||||||
: "") +
|
: "") +
|
||||||
@@ -519,19 +538,23 @@ export default async function ApiProxy(req, res) {
|
|||||||
item.LogicalCollectionName == "pinswg_maintenanceoflands217s" ||
|
item.LogicalCollectionName == "pinswg_maintenanceoflands217s" ||
|
||||||
item.LogicalCollectionName ==
|
item.LogicalCollectionName ==
|
||||||
"pinswg_enforcementlistedbuildingconservationaps" ||
|
"pinswg_enforcementlistedbuildingconservationaps" ||
|
||||||
item.LogicalCollectionName == "pinswg_dnses"
|
item.LogicalCollectionName == "pinswg_dnses" ||
|
||||||
|
item.LogicalCollectionName == "pinswg_sipses"
|
||||||
? ",_pinswg_associatedlpa_value"
|
? ",_pinswg_associatedlpa_value"
|
||||||
: "");
|
: "") +
|
||||||
|
(item.LogicalCollectionName == "pinswg_sipses"
|
||||||
|
? ",_pinswg_sipscase_value"
|
||||||
|
: ",_" + item.PrimaryIdAttribute + "s_value");
|
||||||
|
|
||||||
console.log(
|
// console.log(
|
||||||
"\n==========================================\n",
|
// "\n==========================================\n",
|
||||||
"basic search: " + queryUrl,
|
// "basic search: " + queryUrl,
|
||||||
"\n\n",
|
// "\n\n",
|
||||||
item.LogicalCollectionName,
|
// item.LogicalCollectionName,
|
||||||
"\n\n",
|
// "\n\n",
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
// WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
"\n==========================================\n"
|
// "\n==========================================\n"
|
||||||
);
|
// );
|
||||||
|
|
||||||
const resultObj = axios
|
const resultObj = axios
|
||||||
.get(
|
.get(
|
||||||
@@ -544,9 +567,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
"pinswg_appealType": item.value,
|
"pinswg_appealType": item.value,
|
||||||
"incidentid":
|
"incidentid":
|
||||||
key[
|
key[
|
||||||
"_" +
|
item.value == "SIPs"
|
||||||
item.NavigationProperty.toLowerCase() +
|
? "_pinswg_sipscase_value"
|
||||||
"_value"
|
: "_" +
|
||||||
|
item.NavigationProperty.toLowerCase() +
|
||||||
|
"_value"
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -567,6 +592,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
const getIncidentResultsObj = await Promise.all(
|
const getIncidentResultsObj = await Promise.all(
|
||||||
searchResultsObj.map(async (key) => {
|
searchResultsObj.map(async (key) => {
|
||||||
|
console.log(key);
|
||||||
var queryUrl =
|
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 " +
|
"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 +
|
key.incidentid +
|
||||||
@@ -582,6 +608,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
return data.value[0];
|
return data.value[0];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"pinswg_publishtoweb: " + incidentObj.pinswg_publishtoweb,
|
||||||
|
"ticketnumber: " + incidentObj.ticketnumber
|
||||||
|
);
|
||||||
Object.assign(key, {
|
Object.assign(key, {
|
||||||
"pinswg_publishtoweb": incidentObj.pinswg_publishtoweb,
|
"pinswg_publishtoweb": incidentObj.pinswg_publishtoweb,
|
||||||
"ticketnumber": incidentObj.ticketnumber,
|
"ticketnumber": incidentObj.ticketnumber,
|
||||||
|
|||||||
Reference in New Issue
Block a user