From 20782db916ed539da7b8c8f04617c9b3ffefd344 Mon Sep 17 00:00:00 2001 From: Robert Bond Date: Wed, 22 Apr 2026 08:15:59 +0000 Subject: [PATCH] Merged PR 2264: updatd createinvolvent call updatd createinvolvent call Related work items: #22441 --- components/search/repsonresults.js | 34 ++++++++----------- .../getbasicsearchdetailspaged_api.js | 26 ++++++++------ pages/api/file/createrepinvolvement_api.js | 9 ++--- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/components/search/repsonresults.js b/components/search/repsonresults.js index 229a9c49..d17d864c 100644 --- a/components/search/repsonresults.js +++ b/components/search/repsonresults.js @@ -7,6 +7,11 @@ const RepsOnResults = (props) => { let { t } = useTranslation(); 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) { let date = new Date(); @@ -32,22 +37,18 @@ const RepsOnResults = (props) => { return isLPA ? true : false; case 846040015: - return props.searchDetailsObj[0].value[0] - .pinswg_specialistcaseprocess == 846040001 + return specialistProcess == 846040001 ? showReps( - props.searchDetailsObj[0].value[0].pinswg_startdate, - props.searchDetailsObj[0].value[0] - .pinswg_finalcommentsduedate + detailsObj.pinswg_startdate, + detailsObj.pinswg_finalcommentsduedate ) : true; case 846040018: let shouldShow = - props.searchDetailsObj[0].value[0] - .pinswg_speacialistcaseprocess == 846040000 && isLPA + specialistProcess == 846040000 && isLPA ? true - : props.searchDetailsObj[0].value[0] - .pinswg_speacialistcaseprocess == 846040001 + : specialistProcess == 846040001 ? true : false; @@ -55,8 +56,8 @@ const RepsOnResults = (props) => { case 846040019: return showReps( - props.searchDetailsObj[0].value[0].pinswg_startdate, - props.searchDetailsObj[0].value[0].pinswg_statementduedate + detailsObj.pinswg_startdate, + detailsObj.pinswg_statementduedate ); default: @@ -122,7 +123,7 @@ const RepsOnResults = (props) => { )} */}
- {props.appealType == 846040002 + {appealType == 846040002 ? t( "case:summary-consultation-open-label" ) @@ -131,9 +132,7 @@ const RepsOnResults = (props) => { )}{" "}
- ) : !isLPA && - props.currentView.caseReference.appealType == - 846040004 ? ( + ) : !isLPA && appealType == 846040004 ? ( "" ) : ( <> @@ -147,10 +146,7 @@ const RepsOnResults = (props) => { detailsObj.pinswg_startdate ), endDate: - props.currentView - .caseReference - .appealType == - 846040019 + appealType == 846040019 ? formatDates( detailsObj.pinswg_statementduedate ) diff --git a/pages/api/endpoint/getbasicsearchdetailspaged_api.js b/pages/api/endpoint/getbasicsearchdetailspaged_api.js index 95defa60..c0ea5b18 100644 --- a/pages/api/endpoint/getbasicsearchdetailspaged_api.js +++ b/pages/api/endpoint/getbasicsearchdetailspaged_api.js @@ -76,6 +76,9 @@ export default async function ApiProxy(req, res) { primaryIdAttribute ).NavigationProperty; + const isPagedFilterExpression = + incidentID.includes(" eq ") || incidentID.includes(" or "); + let queryUrl = appealTypeName + "?$filter=" + @@ -101,21 +104,24 @@ export default async function ApiProxy(req, res) { "&$count=true"; try { - const [searchResult, incidentResult] = await Promise.all([ - relayGetData({ - queryUrl, - requestOptionsBuilder: (accessToken) => - azureHeadersPaged(accessToken) - }), - relayGetData({ + const searchResult = await relayGetData({ + queryUrl, + requestOptionsBuilder: (accessToken) => + azureHeadersPaged(accessToken) + }); + + let incidentResult = null; + + if (!isPagedFilterExpression) { + incidentResult = await relayGetData({ queryUrl: incidentQueryUrl, requestOptionsBuilder: (accessToken) => azureHeaders(accessToken) - }) - ]); + }); + } const data = searchResult.data; - const incidentData = incidentResult.data; + const incidentData = incidentResult?.data; const additionalLPAs = incidentData?.pinswg_Incident_Account_AdditionalLPAs || []; diff --git a/pages/api/file/createrepinvolvement_api.js b/pages/api/file/createrepinvolvement_api.js index 01329838..a48534fa 100644 --- a/pages/api/file/createrepinvolvement_api.js +++ b/pages/api/file/createrepinvolvement_api.js @@ -45,16 +45,13 @@ export default async function ApiProxy(req, res) { const crmUrl = "https://" + process.env.CRMURL; const crmVersion = process.env.CRMURL_VERSION; - // appeallant - // interestedParty - // agent - var typeofinvolvement = { "appellant": 846040001, "interestedparty": 846040061, - "agent": 846040000 - }[req.body.typeofinvolvement] || 846040061; + "agent": 846040000, + "LPA": 846040012 + }[req.body.involvement] || 846040061; const data = { "pinswg_email": userInfo.emailaddress1,