updated query to remove ldp and misc types
This commit is contained in:
@@ -88,17 +88,17 @@ const Home = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) =>
|
||||
async ({ query, req, res }) => {
|
||||
const appealTypeData = await getAppealsTypes();
|
||||
const lpaData = await getLPA();
|
||||
console.log("appeal types", appealTypeData);
|
||||
console.log("lpa typeswwwww", lpaData);
|
||||
store.dispatch(setAppealType(appealTypeData));
|
||||
store.dispatch(setLPA(lpaData));
|
||||
}
|
||||
);
|
||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
||||
// (store) =>
|
||||
// async ({ query, req, res }) => {
|
||||
// const appealTypeData = await getAppealsTypes();
|
||||
// const lpaData = await getLPA();
|
||||
// console.log("appeal types", appealTypeData);
|
||||
// console.log("lpa typeswwwww", lpaData);
|
||||
// store.dispatch(setAppealType(appealTypeData));
|
||||
// store.dispatch(setLPA(lpaData));
|
||||
// }
|
||||
// );
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
|
||||
+29
-13
@@ -15,6 +15,7 @@ import { wrapper } from "../../store/store";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import data from "../../data/collections.json";
|
||||
import nookies from "nookies";
|
||||
import {
|
||||
setLoggedInUserId,
|
||||
setAccountDetails,
|
||||
@@ -34,6 +35,7 @@ import {
|
||||
} from "../../store/awaitingSubmission/action";
|
||||
import {
|
||||
getSASToken,
|
||||
getPersonalAccount,
|
||||
getMyCases,
|
||||
getMyRepresentations,
|
||||
getWatchedCases,
|
||||
@@ -157,21 +159,35 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
console.log("qweqe ", loggedInUser);
|
||||
|
||||
const [myCases, myRepresentations, watchedCases, awaitingSubmission] =
|
||||
await Promise.all([
|
||||
await getMyCases(token, loggedInUser),
|
||||
await getMyRepresentations(token, loggedInUser),
|
||||
await getWatchedCases(token, loggedInUser),
|
||||
await getAwaitingSubmission(token),
|
||||
]);
|
||||
const [
|
||||
accountDetails,
|
||||
myCases,
|
||||
myRepresentations,
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
] = await Promise.all([
|
||||
await getPersonalAccount(token, loggedInUser),
|
||||
await getMyCases(token, loggedInUser),
|
||||
await getMyRepresentations(token, loggedInUser),
|
||||
await getWatchedCases(token, loggedInUser),
|
||||
await getAwaitingSubmission(token),
|
||||
]);
|
||||
|
||||
// const cookiesMaker = new Cookies(req, res);
|
||||
console.log("perosnal: ", accountDetails);
|
||||
|
||||
// cookiesMaker.set("pinsUser", query.q, {
|
||||
// httpOnly: true, // true by default
|
||||
// });
|
||||
//const cookiesMaker = nookies.get(ctx)
|
||||
|
||||
let now = new Date();
|
||||
let expDate = new Date(now);
|
||||
expDate.setDate(now.getDate() + 1);
|
||||
|
||||
nookies.set(ctx, "pinsUser", query.q, {
|
||||
expires: expDate,
|
||||
httpOnly: false,
|
||||
});
|
||||
|
||||
console.log(" from cookie ", cookies);
|
||||
|
||||
// console.log(" from cookie ", cookiesMaker.get("pinsUser"));
|
||||
console.log(myCases);
|
||||
|
||||
const [
|
||||
@@ -187,7 +203,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
]);
|
||||
|
||||
console.log(myCasesDetails);
|
||||
|
||||
store.dispatch(setAccountDetails(accountDetails));
|
||||
store.dispatch(setLoggedInUserId(loggedInUser));
|
||||
store.dispatch(setMyCases(myCases));
|
||||
store.dispatch(setMyCasesDetails(myCasesDetails));
|
||||
|
||||
Reference in New Issue
Block a user