diff --git a/actions/index.js b/actions/index.js index 68b8226e..c68ace3c 100644 --- a/actions/index.js +++ b/actions/index.js @@ -1,5 +1,6 @@ import axios from "axios"; import CryptoJS from "crypto-js"; +import _ from "lodash"; let BASE_URL; const port = parseInt(process.env.PORT, 10) || 3000; @@ -41,21 +42,45 @@ export const consoleLogger = (err) => { var errStr = "\n\n/////////////////////////////////////////////////\nServer Error " + "\n" + - (err.hasOwnProperty("response") - ? err.response.status + - " : " + - err.response.statusText + - "\nRequest IP: " + - err.response.request.hasOwnProperty("socket") - ? err.response.request.hasOwnProperty("remoteAddress") - ? err.response.request.socket.remoteAddress - : "" - : "" + - "\nRequest URL: " + - err.response.config.url + - "\nRequest Time: " + - err.response.headers.date - : err) + + (_.has(err, "response.status") + ? "Status: " + err.response.status + "\n" + : "") + + (_.has(err, "response.statusText") + ? "\nStatusText: " + err.response.status + "\n" + : "") + + (_.has(err, "response.request.socket.remoteAddress") + ? "\nRequest IP: " + + err.response.request.socket.remoteAddress + + "\n" + : "") + + (_.has(err, "response.data.error.message") + ? "\nMessage: " + err.response.data.error.message + "\n" + : "") + + (_.has(err, "response.config.url") + ? "\nRequest URL: " + err.config.url + "\n" + : "") + + (_.has(err, "response.headers.date") + ? "\nRequest Time: " + err.response.headers.date + "\n" + : "") + + // ( + // err.hasOwnProperty("response") + // ? err.response.hasOwnProperty("status") + // ? err.response.status + + // " : " + + // err.response.statusText + + // "\nRequest IP: " + + // err.response.request.hasOwnProperty("socket") + // ? err.response.request.hasOwnProperty("remoteAddress") + // ? err.response.request.socket.remoteAddress + // : "" + // : "" + + // "\nRequest URL: " + + // err.response.config.url + + // "\nRequest Time: " + + // err.response.headers.date + // : err + // : err.response + // ) + "\n/////////////////////////////////////////////////\n\n"; return errStr; }; diff --git a/actions/selectQueryTypes.js b/actions/selectQueryTypes.js index 336391fb..bdaf55c3 100644 --- a/actions/selectQueryTypes.js +++ b/actions/selectQueryTypes.js @@ -32,7 +32,7 @@ export const getSelectQuery = (appealTypeName) => { return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent"; break; case "pinswg_householderappealhases": - return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode"; + return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstmt,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode"; break; case "pinswg_enforcementnoticeappeals174s": return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent"; diff --git a/components/case/summaryTypes/pinswg_householderappealhasid.js b/components/case/summaryTypes/pinswg_householderappealhasid.js index 5b33787d..822dcb7c 100644 --- a/components/case/summaryTypes/pinswg_householderappealhasid.js +++ b/components/case/summaryTypes/pinswg_householderappealhasid.js @@ -296,26 +296,26 @@ const Pinswg_householderappealhasid = (props) => {
{_.has( detailsObj, - "pinswg_otherpartiesstatement" + "pinswg_otherpartiesstmt" ) ? !_.isEmpty( - detailsObj.pinswg_otherpartiesstatement + detailsObj.pinswg_otherpartiesstmt ) ? formatDates( - detailsObj.pinswg_otherpartiesstatement + detailsObj.pinswg_otherpartiesstmt ) : t( "case:summary-no-date-entered-label" ) : _.has( detailsObj, - "pinswg_otherpartiesstatements" + "pinswg_otherpartiesstmt" ) ? !_.isEmpty( - detailsObj.pinswg_otherpartiesstatements + detailsObj.pinswg_otherpartiesstmt ) ? formatDates( - detailsObj.pinswg_otherpartiesstatements + detailsObj.pinswg_otherpartiesstmt ) : t( "case:summary-no-date-entered-label" diff --git a/data/mandatoryfields/pinswg_householderappealhas.json b/data/mandatoryfields/pinswg_householderappealhas.json index 4b912470..736c0396 100644 --- a/data/mandatoryfields/pinswg_householderappealhas.json +++ b/data/mandatoryfields/pinswg_householderappealhas.json @@ -605,7 +605,7 @@ "MetadataId": "78d637c9-3342-4e69-99fe-154ecec5debe" }, { - "LogicalName": "pinswg_otherpartiesstatement", + "LogicalName": "pinswg_otherpartiesstmt", "RequiredLevel": { "Value": "None", "CanBeChanged": true,