reps defects
This commit is contained in:
@@ -30,8 +30,8 @@ import {
|
||||
|
||||
import NoSessionWarning from "../../components/nosession";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
const RepresentationF = (props) => {
|
||||
const { footerLinks, pages, accountDetails } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -40,26 +40,26 @@ const Home = (props) => {
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
// useEffect(() => {
|
||||
// const updateAccountStore = async () => {
|
||||
// const thisSession = await getSession();
|
||||
useEffect(() => {
|
||||
const updateAccountStore = async () => {
|
||||
const thisSession = await getSession();
|
||||
|
||||
// if (thisSession) {
|
||||
// let loggedInUser = await getPortalLogin(thisSession.user.email);
|
||||
// dispatch(
|
||||
// setAccountDetails(
|
||||
// await getPersonalAccount(
|
||||
// loggedInUser.value[0].contactid
|
||||
// )
|
||||
// )
|
||||
// );
|
||||
// dispatch(setContainerID(thisSession.user.id));
|
||||
|
||||
// //dispatch(setRepresentationSubmit(true));
|
||||
// }
|
||||
// };
|
||||
// updateAccountStore();
|
||||
// }, [dispatch]);
|
||||
if (thisSession) {
|
||||
let loggedInUser = await getPortalLogin(thisSession.user.email);
|
||||
dispatch(
|
||||
setAccountDetails(
|
||||
await getPersonalAccount(
|
||||
loggedInUser.value[0].contactid
|
||||
)
|
||||
)
|
||||
);
|
||||
dispatch(setContainerID(thisSession.user.id));
|
||||
dispatch(setLoggedInUserId(loggedInUser.value[0].contactid));
|
||||
//dispatch(setRepresentationSubmit(true));
|
||||
}
|
||||
};
|
||||
updateAccountStore();
|
||||
}, [dispatch]);
|
||||
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
@@ -158,6 +158,13 @@ const Home = (props) => {
|
||||
currentType={
|
||||
props.currentView.caseReference.currentType
|
||||
}
|
||||
appealTypeID={
|
||||
props.currentView.caseReference.appealType
|
||||
}
|
||||
incidentid={props.currentView.caseReference.incidentid}
|
||||
representationsObj={
|
||||
props.searchResultsObj.representationsObj
|
||||
}
|
||||
props={props}
|
||||
/>
|
||||
</div>
|
||||
@@ -174,15 +181,37 @@ const Home = (props) => {
|
||||
|
||||
// const { cookies } = req;
|
||||
|
||||
// let loggedInUser = cookies.pinsUser;
|
||||
// let loggedInUserCookie = cookies.pinsUser;
|
||||
|
||||
// let thisSession = await getSession(ctx);
|
||||
// let loggedInUser = {};
|
||||
|
||||
// console.log(loggedInUser, thisSession);
|
||||
// if (!thisSession) {
|
||||
// console.log("not has sesssion.......");
|
||||
// return {
|
||||
// redirect: {
|
||||
// destination: "/auth/signin",
|
||||
// permanent: false,
|
||||
// },
|
||||
// };
|
||||
// } else {
|
||||
// [loggedInUser] = await Promise.all([
|
||||
// await getPortalLogin(thisSession.user.email),
|
||||
// ]);
|
||||
|
||||
// console.log(
|
||||
// "=====//////////=====",
|
||||
// thisSession,
|
||||
// thisSession.user.email,
|
||||
// loggedInUser
|
||||
// );
|
||||
// loggedInUser = loggedInUser.value[0].contactid;
|
||||
// }
|
||||
|
||||
// const accountDetails = await getPersonalAccount(loggedInUser);
|
||||
// store.dispatch(setAccountDetails(accountDetails));
|
||||
|
||||
// console.log(accountDetails);
|
||||
// store.dispatch(setAccountDetails(accountDetails));
|
||||
// return {
|
||||
// props: {
|
||||
// containerID: thisSession.user.id,
|
||||
@@ -217,4 +246,4 @@ const mapStateToProps = (state) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(RepresentationF);
|
||||
|
||||
Reference in New Issue
Block a user