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
+19 -15
View File
@@ -97,24 +97,27 @@ let Home = (props) => {
let optionsStr = props.appealType.appealTypeOptions.value;
let selectedObj = jsonpath.query(optionsStr, "$..value");
// let selectedObj = jsonpath.query(optionsStr, "$..value");
let selectedObj = jsonpath.query(
optionsStr,
"$..[?(@.attributevalue=='" + router.query.apt + "')]"
);
//let optionsTitleObj = [];
const optionsTitleObj = selectedObj.reduce(
(obj, arrValue) => (
(obj[arrValue] = arrValue
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
.slice(0, 39)),
obj
),
{}
);
// const optionsTitleObj = selectedObj.reduce(
// (obj, arrValue) => (
// (obj[arrValue] = arrValue
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
// .toLowerCase()
// .slice(0, 39)),
// obj
// ),
// {}
// );
const formTitle = Object.keys(optionsTitleObj).find(
(key) => optionsTitleObj[key] === appealtypes
);
const formTitle = selectedObj[0].value;
const getFormType = (appealType) => {
switch (appealType) {
@@ -290,6 +293,7 @@ let Home = (props) => {
formTitle={formTitle}
appealType={props.appealType}
props={props}
key={1}
mandatoryFieldsData={
props.formData.mandatoryFieldsData
}
@@ -335,7 +339,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
pickListData,
formdata,
] = await Promise.all([
await createCase(token, query.apt, loggedInUser),
await createCase(token, query.apt, query.lpa, loggedInUser),
await getAppealsTypes(token),
await getMandatoryFields(token, query.appealtypes),
await getPickLists(token, query.appealtypes),