updated cookie login and watched cases

This commit is contained in:
2021-11-03 08:24:54 +00:00
parent 30a7e426af
commit fa4c765799
20 changed files with 208 additions and 130 deletions
+8 -22
View File
@@ -9,6 +9,7 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { setCurrentSection } from "../../store/appealType/action";
import { updateCase } from "../../actions";
import jsonpath from "jsonpath";
import { getFormCollectionByID } from "../utils";
import data from "../../data/collections.json";
@@ -18,12 +19,11 @@ let CompleteAppeal = (props) => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = props.props.form.appealForm.values;
let appTypeCollection = getFormCollectionByID(
props.appealType.appealTypeID
);
let updateBindAppealTypeToIncident =
"pinswg_" +
props.appealType.caseReference[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
].replace(/(\band|[\s\-\+\(\)\,\&])/g, "") +
"Ids";
appTypeCollection.LogicalName + "Ids";
Object.assign(updateBody, {
"pinswg_Appellant@odata.bind":
@@ -40,23 +40,9 @@ let CompleteAppeal = (props) => {
updateBody = updateBody.replace(/:"Yes"/gm, `:true`);
updateBody = updateBody.replace(/:"No"/gm, `:false`);
updateBody = JSON.parse(updateBody);
let updateFormCollection = getFormCollection(
"pinswg_" +
props.appealType.caseReference[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
]
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
);
let primaryAttribute = getPrimaryAttr(
"pinswg_" +
props.appealType.caseReference[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
]
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
);
let updateFormCollection = appTypeCollection.LogicalCollectionName;
let primaryAttribute = appTypeCollection.PrimaryIdAttribute;
updateCase(
incidentId,
@@ -75,7 +61,7 @@ let CompleteAppeal = (props) => {
const getFormCollection = (formtype) => {
const collectionName = jsonpath.query(
data,
"$..[?(@.LogicalName=='" + formtype + "')].LogicalCollectionName"
"$..[?(@.LogicalName=='" + formtype + "')]"
);
//console.log(collectionName[0]);
return collectionName[0];