added create contact flow for registration
This commit is contained in:
+50
-45
@@ -82,58 +82,63 @@ const Home = (props) => {
|
||||
};
|
||||
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) =>
|
||||
async ({ query, req, res }) => {
|
||||
//console.log("the query", query);
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
console.log("the query", query);
|
||||
|
||||
const token = await getSASToken();
|
||||
const { cookies } = req;
|
||||
|
||||
const [
|
||||
myCases,
|
||||
myRepresentations,
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
] = await Promise.all([
|
||||
await getMyCases(token, "f8b454ed-eded-eb11-aac7-00224800be9c"),
|
||||
await getMyRepresentations(token),
|
||||
await getWatchedCases(token),
|
||||
console.log(cookies);
|
||||
const token = await getSASToken();
|
||||
|
||||
let loggedInUser =
|
||||
typeof query.q == undefined ? cookies.pinsUser : query.q;
|
||||
|
||||
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 cookies = new Cookies(req, res);
|
||||
const cookiesMaker = new Cookies(req, res);
|
||||
|
||||
cookies.set("pinsUser", "f8b454ed-eded-eb11-aac7-00224800be9c", {
|
||||
httpOnly: true, // true by default
|
||||
});
|
||||
//console.log("my cases ", myCases);
|
||||
const [
|
||||
myCasesDetails,
|
||||
// myRepresentationsDetails,
|
||||
// watchedCasesDetails,
|
||||
// awaitingSubmissionDetails,
|
||||
] = await Promise.all([
|
||||
await getDetails(token, myCases),
|
||||
// await getDetails(myRepresentations),
|
||||
// await getDetails(watchedCases),
|
||||
// await getDetails(awaitingSubmission),
|
||||
]);
|
||||
cookiesMaker.set("pinsUser", query.q, {
|
||||
httpOnly: true, // true by default
|
||||
});
|
||||
|
||||
store.dispatch(
|
||||
setLoggedInUserId("f8b454ed-eded-eb11-aac7-00224800be9c")
|
||||
);
|
||||
store.dispatch(setMyCases(myCases));
|
||||
store.dispatch(setMyCasesDetails(myCasesDetails));
|
||||
store.dispatch(setMyRepresentations(myRepresentations));
|
||||
// store.dispatch(
|
||||
// setMyRepresentationsDetails(myRepresentationsDetails)
|
||||
// );
|
||||
store.dispatch(setWatchedCases(watchedCases));
|
||||
//store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||
// store.dispatch(
|
||||
// setAwaitingSubmissionDetails(awaitingSubmissionDetails)
|
||||
// );
|
||||
}
|
||||
console.log(" from cookie ", cookiesMaker.get("pinsUser"));
|
||||
console.log(myCases);
|
||||
|
||||
const [
|
||||
myCasesDetails,
|
||||
myRepresentationsDetails,
|
||||
watchedCasesDetails,
|
||||
// awaitingSubmissionDetails,
|
||||
] = await Promise.all([
|
||||
await getDetails(token, myCases),
|
||||
await getDetails(token, myRepresentations),
|
||||
await getDetails(token, watchedCases),
|
||||
// await getDetails(awaitingSubmission),
|
||||
]);
|
||||
|
||||
console.log(myCasesDetails);
|
||||
|
||||
store.dispatch(setLoggedInUserId(loggedInUser));
|
||||
store.dispatch(setMyCases(myCases));
|
||||
store.dispatch(setMyCasesDetails(myCasesDetails));
|
||||
store.dispatch(setMyRepresentations(myRepresentations));
|
||||
store.dispatch(setMyRepresentationsDetails(myRepresentationsDetails));
|
||||
store.dispatch(setWatchedCases(watchedCases));
|
||||
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||
// store.dispatch(
|
||||
// setAwaitingSubmissionDetails(awaitingSubmissionDetails)
|
||||
// );
|
||||
}
|
||||
);
|
||||
|
||||
const getFormCollection = (formtype) => {
|
||||
|
||||
Reference in New Issue
Block a user