refactor phase 3a myportal case-by-incident imports
This commit is contained in:
@@ -3,12 +3,12 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { getIP } from "../../../../actions/core/logger";
|
||||||
import {
|
import {
|
||||||
getIP,
|
|
||||||
getIncidentbyID,
|
|
||||||
getPersonalAccount,
|
getPersonalAccount,
|
||||||
getPortalLogin,
|
getPortalLogin
|
||||||
} from "../../../../actions";
|
} from "../../../../actions/services/accountService";
|
||||||
|
import { getIncidentbyID } from "../../../../actions/services/caseService";
|
||||||
import Breadcrumbs from "../../../../components/breadcrumbs";
|
import Breadcrumbs from "../../../../components/breadcrumbs";
|
||||||
import Case from "../../../../components/case";
|
import Case from "../../../../components/case";
|
||||||
import CookieBanner from "../../../../components/cookieBanner";
|
import CookieBanner from "../../../../components/cookieBanner";
|
||||||
@@ -112,7 +112,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
if (thisSession) {
|
if (thisSession) {
|
||||||
console.log(" has sesssion.......");
|
console.log(" has sesssion.......");
|
||||||
[loggedInUser] = await Promise.all([
|
[loggedInUser] = await Promise.all([
|
||||||
await getPortalLogin(thisSession.user.email),
|
await getPortalLogin(thisSession.user.email)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
loggedInUser = loggedInUser.value[0].contactid;
|
loggedInUser = loggedInUser.value[0].contactid;
|
||||||
@@ -143,8 +143,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/404",
|
destination: "/404",
|
||||||
permanent: false,
|
permanent: false
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (searchResultsObj["@odata.count"] > 1) {
|
if (searchResultsObj["@odata.count"] > 1) {
|
||||||
@@ -152,8 +152,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
redirect: {
|
redirect: {
|
||||||
//destination: "/dns-not-found",
|
//destination: "/dns-not-found",
|
||||||
destination: "/404",
|
destination: "/404",
|
||||||
permanent: false,
|
permanent: false
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
@@ -163,7 +163,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
"currentType": "searchResultsObj",
|
"currentType": "searchResultsObj",
|
||||||
"incidentid": searchResultsObj.value[0].incidentid,
|
"incidentid": searchResultsObj.value[0].incidentid,
|
||||||
"appealType":
|
"appealType":
|
||||||
searchResultsObj.value[0].pinswg_appealcasetype,
|
searchResultsObj.value[0].pinswg_appealcasetype
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -172,11 +172,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
props: {
|
props: {
|
||||||
searchResultsObj: {
|
searchResultsObj: {
|
||||||
searchResultsObj: searchResultsObj,
|
searchResultsObj: searchResultsObj,
|
||||||
searchDetailsObj: searchDetailsObj,
|
searchDetailsObj: searchDetailsObj
|
||||||
},
|
},
|
||||||
currentType: "directResultsObj",
|
currentType: "directResultsObj",
|
||||||
docsOffline: process.env.DOCAPI_OFFLINE || false,
|
docsOffline: process.env.DOCAPI_OFFLINE || false
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -194,7 +194,7 @@ const mapStateToProps = (state) => {
|
|||||||
myCases: state.myCases,
|
myCases: state.myCases,
|
||||||
watchedCases: state.watchedCases,
|
watchedCases: state.watchedCases,
|
||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
return {
|
return {
|
||||||
setCurrentReference: (currentReference) => {
|
setCurrentReference: (currentReference) => {
|
||||||
dispatch(setCurrentReference(refno));
|
dispatch(setCurrentReference(refno));
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user