Merged PR 2264: updatd createinvolvent call
updatd createinvolvent call Related work items: #22441
This commit is contained in:
@@ -7,6 +7,11 @@ const RepsOnResults = (props) => {
|
|||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const detailsObj = props.detailsObj;
|
const detailsObj = props.detailsObj;
|
||||||
|
const isLPA = Boolean(props?.isLPA);
|
||||||
|
const appealType = props?.appealType || detailsObj?.appealType;
|
||||||
|
const specialistProcess =
|
||||||
|
detailsObj?.pinswg_speacialistcaseprocess ||
|
||||||
|
detailsObj?.pinswg_specialistcaseprocess;
|
||||||
|
|
||||||
function showReps(startDate, endDate) {
|
function showReps(startDate, endDate) {
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
@@ -32,22 +37,18 @@ const RepsOnResults = (props) => {
|
|||||||
return isLPA ? true : false;
|
return isLPA ? true : false;
|
||||||
|
|
||||||
case 846040015:
|
case 846040015:
|
||||||
return props.searchDetailsObj[0].value[0]
|
return specialistProcess == 846040001
|
||||||
.pinswg_specialistcaseprocess == 846040001
|
|
||||||
? showReps(
|
? showReps(
|
||||||
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
detailsObj.pinswg_startdate,
|
||||||
props.searchDetailsObj[0].value[0]
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
.pinswg_finalcommentsduedate
|
|
||||||
)
|
)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
case 846040018:
|
case 846040018:
|
||||||
let shouldShow =
|
let shouldShow =
|
||||||
props.searchDetailsObj[0].value[0]
|
specialistProcess == 846040000 && isLPA
|
||||||
.pinswg_speacialistcaseprocess == 846040000 && isLPA
|
|
||||||
? true
|
? true
|
||||||
: props.searchDetailsObj[0].value[0]
|
: specialistProcess == 846040001
|
||||||
.pinswg_speacialistcaseprocess == 846040001
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
@@ -55,8 +56,8 @@ const RepsOnResults = (props) => {
|
|||||||
|
|
||||||
case 846040019:
|
case 846040019:
|
||||||
return showReps(
|
return showReps(
|
||||||
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
detailsObj.pinswg_startdate,
|
||||||
props.searchDetailsObj[0].value[0].pinswg_statementduedate
|
detailsObj.pinswg_statementduedate
|
||||||
);
|
);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -122,7 +123,7 @@ const RepsOnResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
</Link> */}
|
</Link> */}
|
||||||
<div className="govuk-body govuk-!-font-size-14">
|
<div className="govuk-body govuk-!-font-size-14">
|
||||||
{props.appealType == 846040002
|
{appealType == 846040002
|
||||||
? t(
|
? t(
|
||||||
"case:summary-consultation-open-label"
|
"case:summary-consultation-open-label"
|
||||||
)
|
)
|
||||||
@@ -131,9 +132,7 @@ const RepsOnResults = (props) => {
|
|||||||
)}{" "}
|
)}{" "}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : !isLPA &&
|
) : !isLPA && appealType == 846040004 ? (
|
||||||
props.currentView.caseReference.appealType ==
|
|
||||||
846040004 ? (
|
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -147,10 +146,7 @@ const RepsOnResults = (props) => {
|
|||||||
detailsObj.pinswg_startdate
|
detailsObj.pinswg_startdate
|
||||||
),
|
),
|
||||||
endDate:
|
endDate:
|
||||||
props.currentView
|
appealType == 846040019
|
||||||
.caseReference
|
|
||||||
.appealType ==
|
|
||||||
846040019
|
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_statementduedate
|
detailsObj.pinswg_statementduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ export default async function ApiProxy(req, res) {
|
|||||||
primaryIdAttribute
|
primaryIdAttribute
|
||||||
).NavigationProperty;
|
).NavigationProperty;
|
||||||
|
|
||||||
|
const isPagedFilterExpression =
|
||||||
|
incidentID.includes(" eq ") || incidentID.includes(" or ");
|
||||||
|
|
||||||
let queryUrl =
|
let queryUrl =
|
||||||
appealTypeName +
|
appealTypeName +
|
||||||
"?$filter=" +
|
"?$filter=" +
|
||||||
@@ -101,21 +104,24 @@ export default async function ApiProxy(req, res) {
|
|||||||
"&$count=true";
|
"&$count=true";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [searchResult, incidentResult] = await Promise.all([
|
const searchResult = await relayGetData({
|
||||||
relayGetData({
|
queryUrl,
|
||||||
queryUrl,
|
requestOptionsBuilder: (accessToken) =>
|
||||||
requestOptionsBuilder: (accessToken) =>
|
azureHeadersPaged(accessToken)
|
||||||
azureHeadersPaged(accessToken)
|
});
|
||||||
}),
|
|
||||||
relayGetData({
|
let incidentResult = null;
|
||||||
|
|
||||||
|
if (!isPagedFilterExpression) {
|
||||||
|
incidentResult = await relayGetData({
|
||||||
queryUrl: incidentQueryUrl,
|
queryUrl: incidentQueryUrl,
|
||||||
requestOptionsBuilder: (accessToken) =>
|
requestOptionsBuilder: (accessToken) =>
|
||||||
azureHeaders(accessToken)
|
azureHeaders(accessToken)
|
||||||
})
|
});
|
||||||
]);
|
}
|
||||||
|
|
||||||
const data = searchResult.data;
|
const data = searchResult.data;
|
||||||
const incidentData = incidentResult.data;
|
const incidentData = incidentResult?.data;
|
||||||
const additionalLPAs =
|
const additionalLPAs =
|
||||||
incidentData?.pinswg_Incident_Account_AdditionalLPAs || [];
|
incidentData?.pinswg_Incident_Account_AdditionalLPAs || [];
|
||||||
|
|
||||||
|
|||||||
@@ -45,16 +45,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
const crmUrl = "https://" + process.env.CRMURL;
|
const crmUrl = "https://" + process.env.CRMURL;
|
||||||
const crmVersion = process.env.CRMURL_VERSION;
|
const crmVersion = process.env.CRMURL_VERSION;
|
||||||
|
|
||||||
// appeallant
|
|
||||||
// interestedParty
|
|
||||||
// agent
|
|
||||||
|
|
||||||
var typeofinvolvement =
|
var typeofinvolvement =
|
||||||
{
|
{
|
||||||
"appellant": 846040001,
|
"appellant": 846040001,
|
||||||
"interestedparty": 846040061,
|
"interestedparty": 846040061,
|
||||||
"agent": 846040000
|
"agent": 846040000,
|
||||||
}[req.body.typeofinvolvement] || 846040061;
|
"LPA": 846040012
|
||||||
|
}[req.body.involvement] || 846040061;
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
"pinswg_email": userInfo.emailaddress1,
|
"pinswg_email": userInfo.emailaddress1,
|
||||||
|
|||||||
Reference in New Issue
Block a user