logic to let child cases be shown in case details

This commit is contained in:
2021-09-30 17:11:33 +01:00
parent 0a5e756bb2
commit 4a7245db20
13 changed files with 171 additions and 40 deletions
+11 -6
View File
@@ -33,6 +33,7 @@ import {
setAwaitingSubmissionDetails,
} from "../../store/awaitingSubmission/action";
import {
getSASToken,
getMyCases,
getMyRepresentations,
getWatchedCases,
@@ -85,16 +86,19 @@ export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
//console.log("the query", query);
const token = await getSASToken();
const [
myCases,
myRepresentations,
watchedCases,
awaitingSubmission,
] = await Promise.all([
await getMyCases("f8b454ed-eded-eb11-aac7-00224800be9c"),
await getMyRepresentations(),
await getWatchedCases(),
await getAwaitingSubmission(),
await getMyCases(token, "f8b454ed-eded-eb11-aac7-00224800be9c"),
await getMyRepresentations(token),
await getWatchedCases(token),
await getAwaitingSubmission(token),
]);
const cookies = new Cookies(req, res);
@@ -109,7 +113,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
// watchedCasesDetails,
// awaitingSubmissionDetails,
] = await Promise.all([
await getDetails(myCases),
await getDetails(token, myCases),
// await getDetails(myRepresentations),
// await getDetails(watchedCases),
// await getDetails(awaitingSubmission),
@@ -142,7 +146,7 @@ const getFormCollection = (formtype) => {
return collectionName[0];
};
const getDetails = (resultsObj) => {
const getDetails = (token, resultsObj) => {
//console.log(resultsObj);
let detailsArr = [];
resultsObj = resultsObj.value;
@@ -152,6 +156,7 @@ const getDetails = (resultsObj) => {
} else {
detailsArr.push(
getPortalModuelDetails(
token,
getFormCollection(
"pinswg_" +
searchDetail[