Merged PR 2263: createinvolvement updates contactinvolvement table
createinvolvement updates contactinvolvement table Related work items: #22441
This commit is contained in:
@@ -274,10 +274,14 @@ export const sendRepCompleteMessage = async (
|
||||
});
|
||||
};
|
||||
|
||||
export const setRepInvolvment = async (caseid, contactid) => {
|
||||
export const setRepInvolvment = async (caseid, contactid, involvement) => {
|
||||
var queryUrl = buildFileQuery("/api/file/createrepinvolvement_api");
|
||||
|
||||
var data = { "incidentid": caseid, "contactid": contactid };
|
||||
var data = {
|
||||
"incidentid": caseid,
|
||||
"contactid": contactid,
|
||||
"involvement": involvement
|
||||
};
|
||||
var config = {
|
||||
method: "post",
|
||||
url: queryUrl,
|
||||
|
||||
@@ -66,7 +66,8 @@ const RepComplete = (props) => {
|
||||
(props.props.currentView.representationMessageSent != true &&
|
||||
(setRepInvolvment(
|
||||
props.props.currentView.caseReference.incidentid,
|
||||
props.props.props.props.accountDetails.accountDetails.contactid
|
||||
props.props.props.props.accountDetails.accountDetails.contactid,
|
||||
props.props.currentView.representationCapacity
|
||||
),
|
||||
sendRepCompleteMessage(
|
||||
props.props.props.props.accountDetails.containerID,
|
||||
|
||||
@@ -15,6 +15,7 @@ import { consoleLogger } from "../../../actions/core/logger";
|
||||
import { getToken } from "../../../actions/core/token";
|
||||
import { hashAPIPath } from "../../../actions/core/hash";
|
||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||
import { getPersonalAccount } from "../../../actions";
|
||||
|
||||
const WEBAPI_URL =
|
||||
process.env.RELAY_ROOT ||
|
||||
@@ -37,17 +38,31 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
const token = await getToken();
|
||||
const contactid = req.body.contactid;
|
||||
const queryUrl =
|
||||
"incidents(" +
|
||||
req.body.incidentid +
|
||||
")/pinswg_incident_contact_case_involvement/$ref";
|
||||
const incidentid = req.body.incidentid;
|
||||
const queryUrl = "pinswg_contactinvolvements";
|
||||
const userInfo = await getPersonalAccount(contactid);
|
||||
|
||||
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;
|
||||
|
||||
const data = {
|
||||
"@odata.id":
|
||||
crmUrl + "/api/data/" + crmVersion + "/contacts(" + contactid + ")"
|
||||
"pinswg_email": userInfo.emailaddress1,
|
||||
"pinswg_lastname": userInfo.lastname,
|
||||
"pinswg_firstname": userInfo.firstname,
|
||||
"pinswg_typeofinvolvement": typeofinvolvement,
|
||||
"pinswg_Case@odata.bind": "/incidents(" + incidentid + ")",
|
||||
"pinswg_Contact@odata.bind": "/contacts(" + contactid + ")"
|
||||
};
|
||||
|
||||
const config = {
|
||||
|
||||
Reference in New Issue
Block a user