Merged PR 2665: 25470 testing authentication handler
Related work items: #25470
This commit is contained in:
+27
-8
@@ -317,11 +317,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
const limitRequests = pLimit(5);
|
||||
const arr = [];
|
||||
|
||||
const list =
|
||||
detailsType === "mySubmittedReps"
|
||||
? resultsObj
|
||||
: resultsObj.value;
|
||||
|
||||
const list = resultsObj.value;
|
||||
// detailsType === "mySubmittedReps"
|
||||
// ? resultsObj
|
||||
// : resultsObj.value;
|
||||
// console.log(list);
|
||||
const tasks = list.map((item) =>
|
||||
limitRequests(async () => {
|
||||
try {
|
||||
@@ -374,18 +374,37 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
return arr;
|
||||
};
|
||||
|
||||
const DASHBOARD_LIMIT = 3;
|
||||
|
||||
const limitResults = (data) => ({
|
||||
...data,
|
||||
value: (data?.value ?? []).slice(0, DASHBOARD_LIMIT)
|
||||
});
|
||||
|
||||
const [
|
||||
myCasesDetails,
|
||||
watchedCasesDetails,
|
||||
mySubmittedRepsDetails,
|
||||
myRepresentationsDetails
|
||||
] = await Promise.all([
|
||||
getDetails(myCases, "myCases"),
|
||||
getDetails(filteredWatchedCases, "myWatchedCases"),
|
||||
getDetails(mySubmittedReps, "mySubmittedReps"),
|
||||
getDetails(limitResults(myCases), "myCases"),
|
||||
getDetails(limitResults(filteredWatchedCases), "myWatchedCases"),
|
||||
getDetails(limitResults(mySubmittedReps), "mySubmittedReps"),
|
||||
getDetails(myRepresentations, "myRepresentations")
|
||||
]);
|
||||
|
||||
// const [
|
||||
// myCasesDetails,
|
||||
// watchedCasesDetails,
|
||||
// mySubmittedRepsDetails,
|
||||
// myRepresentationsDetails
|
||||
// ] = await Promise.all([
|
||||
// getDetails(limitResults(myCases), "myCases"),
|
||||
// getDetails(limitResults(filteredWatchedCases), "myWatchedCases"),
|
||||
// getDetails(limitResults(mySubmittedReps), "mySubmittedReps"),
|
||||
// getDetails(limitResults(myRepresentations), "myRepresentations")
|
||||
// ]);
|
||||
|
||||
store.dispatch(setAccountDetails(accountDetails));
|
||||
store.dispatch(setLoggedInUserId(loggedInUser));
|
||||
store.dispatch(setMyCases(myCases));
|
||||
|
||||
Reference in New Issue
Block a user