logic to let child cases be shown in case details
This commit is contained in:
+11
-6
@@ -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[
|
||||
|
||||
Reference in New Issue
Block a user