diff --git a/components/myportal/mysubmittedrepresentations.js b/components/myportal/mysubmittedrepresentations.js index ba3bb461..8a6b2b0f 100644 --- a/components/myportal/mysubmittedrepresentations.js +++ b/components/myportal/mysubmittedrepresentations.js @@ -26,7 +26,7 @@ const MySubmittedReps = (props) => { showDetails={ props.mySubmittedReps.mySubmittedRepsDetails } - topThreeType={"watchedCases"} + topThreeType={"mySubmittedReps"} showLoginCheck={props.showLoginCheck} currentView={props.currentView} myReps={props.myReps} diff --git a/pages/myportal/index.js b/pages/myportal/index.js index 09b7f232..b8eb5d63 100644 --- a/pages/myportal/index.js +++ b/pages/myportal/index.js @@ -361,7 +361,7 @@ export const getServerSideProps = wrapper.getServerSideProps( } ); -const getDetails = (resultsObj, detailsType) => { +const getDetails = async (resultsObj, detailsType) => { let detailsArr = []; resultsObj = @@ -401,49 +401,49 @@ const getDetails = (resultsObj, detailsType) => { }); } - // const detailsObj = resultsObj.map(async (searchDetail, index) => { - // let caseID = ""; + const detailsObj = resultsObj.map((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); + // console.log(detArr); return detArr; };