wrapped calls in promise all

This commit is contained in:
2021-07-30 14:24:22 +01:00
parent 2b14eaaf1f
commit 9e9a168460
6 changed files with 43 additions and 16 deletions
+11 -4
View File
@@ -70,10 +70,17 @@ export const getServerSideProps = wrapper.getServerSideProps(
async ({ query, req, res }) => {
//console.log("the query", query);
const myCases = await getMyCases();
const myRepresentations = await getMyRepresentations();
const watchedCases = await getWatchedCases();
const awaitingSubmission = await getAwaitingSubmission();
const [
myCases,
myRepresentations,
watchedCases,
awaitingSubmission,
] = await Promise.all([
await getMyCases(),
await getMyRepresentations(),
await getWatchedCases(),
await getAwaitingSubmission(),
]);
store.dispatch(setMyCases(myCases));
store.dispatch(setMyRepresentations(myRepresentations));