Merged PR 2264: updatd createinvolvent call
updatd createinvolvent call Related work items: #22441
This commit is contained in:
@@ -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 || [];
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user