added fixes to reduce error when calling module details and filtering of docs

This commit is contained in:
2024-11-06 17:34:30 +00:00
parent cd918ef69c
commit d187907802
18 changed files with 1277 additions and 269 deletions
+37 -37
View File
@@ -399,46 +399,46 @@ const getDetails = (resultsObj, detailsType) => {
});
}
const detailsObj = resultsObj.map((searchDetail, index) => {
let caseID = "";
// const detailsObj = resultsObj.map(async (searchDetail, index) => {
// let caseID = "";
switch (detailsType) {
case "myCases":
caseID = searchDetail.pinswg_title;
break;
case "myWatchedCases":
case "mySubmittedReps":
caseID =
searchDetail[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
];
break;
case "awaitingSubmission":
caseID = searchDetail.ticketnumber;
break;
case "myRepresentations":
caseID = searchDetail.casereference;
break;
default:
caseID = searchDetail.pinswg_title;
}
// switch (detailsType) {
// case "myCases":
// caseID = searchDetail.pinswg_title;
// break;
// case "myWatchedCases":
// case "mySubmittedReps":
// caseID =
// searchDetail[
// "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
// ];
// break;
// case "awaitingSubmission":
// caseID = searchDetail.ticketnumber;
// break;
// case "myRepresentations":
// caseID = searchDetail.casereference;
// break;
// default:
// caseID = searchDetail.pinswg_title;
// }
//console.log(detailsType, " case id : ", caseID);
// console.log(detailsType, " case id : ", caseID);
searchDetail.pinswg_appealcasetype != null &&
detailsArr.push(
getPortalModuleDetails(
getFormCollectionByID(searchDetail.pinswg_appealcasetype)
.LogicalCollectionName,
caseID
// detailsType != "myWatchedCases"
// ? searchDetail.ticketnumber
// : searchDetail[
// "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
// ]
)
);
});
// searchDetail.pinswg_appealcasetype != null &&
// detailsArr.push(
// getPortalModuleDetails(
// getFormCollectionByID(searchDetail.pinswg_appealcasetype)
// .LogicalCollectionName,
// caseID
// // detailsType != "myWatchedCases"
// // ? searchDetail.ticketnumber
// // : searchDetail[
// // "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
// // ]
// )
// );
// });
let detArr = Promise.all(detailsArr);
console.log(detArr);