@@ -3,7 +3,7 @@ import OSPoint from "ospoint";
|
||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||
import { relayGetData } from "../middleware/relayForwarding";
|
||||
import transLookup from "../../../data/lookuptranslations.json";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||
|
||||
const renameKeys = (obj) => {
|
||||
const keyMappings = {
|
||||
@@ -132,23 +132,17 @@ const renameKeys = (obj) => {
|
||||
renamedObj.northing = String(renamedObj.northing);
|
||||
}
|
||||
|
||||
renamedObj.lpaDisplayName_cy = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
renamedObj.lpaDisplayName +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true
|
||||
})[0];
|
||||
renamedObj.lpaDisplayName_cy = resolveCrmDisplayValue({
|
||||
value: renamedObj.lpaDisplayName,
|
||||
locale: "cy",
|
||||
translations: transLookup
|
||||
});
|
||||
|
||||
renamedObj.statusCodeDescription_cy = jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value=="' +
|
||||
renamedObj.statusCodeDescription +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true
|
||||
})[0];
|
||||
renamedObj.statusCodeDescription_cy = resolveCrmDisplayValue({
|
||||
value: renamedObj.statusCodeDescription,
|
||||
locale: "cy",
|
||||
translations: transLookup
|
||||
});
|
||||
|
||||
return renamedObj;
|
||||
};
|
||||
|
||||
@@ -51,14 +51,6 @@ export default async function ApiProxy(req, res) {
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(
|
||||
// '$..[?(@ && @.name="' + lpaid + '")]',
|
||||
// lpaList,
|
||||
// lpaid,
|
||||
// "LPAGUID=",
|
||||
// lpaGUID
|
||||
// );
|
||||
|
||||
const queryUrl =
|
||||
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_pinswg_associatedlpa_value eq " +
|
||||
lpaGUID[0].accountid +
|
||||
|
||||
Reference in New Issue
Block a user