reps defects
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
} from "../../../store/accountDetails/action";
|
||||
|
||||
const CaseHome = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
const { footerLinks, pages, setSearchResults, setSearchDetails } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -54,12 +54,10 @@ const CaseHome = (props) => {
|
||||
props={props}
|
||||
myCases={props.myCases.myCases}
|
||||
myCasesDetails={props.myCases.myCasesDetails}
|
||||
directSearchResultsObj={
|
||||
props.searchResultsObj.searchResultsObj
|
||||
}
|
||||
searchDetailsObj={
|
||||
props.searchResultsObj.searchDetailsObj
|
||||
}
|
||||
// directSearchResultsObj={
|
||||
// props.searchResultsObj.searchResultsObj
|
||||
// }
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
myRepresentations={
|
||||
props.myRepresentations.myRepresentations
|
||||
@@ -72,18 +70,13 @@ const CaseHome = (props) => {
|
||||
props.awaitingSubmission.awaitingSubmission
|
||||
}
|
||||
caseReference={
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.ticketnumber
|
||||
props.currentView.caseReference.currentReference
|
||||
}
|
||||
currentType={props.currentType}
|
||||
appealTypeID={
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.pinswg_appealcasetype
|
||||
}
|
||||
incidentid={
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.incidentid
|
||||
props.currentView.caseReference.appealType
|
||||
}
|
||||
incidentid={props.currentView.caseReference.incidentid}
|
||||
representationsObj={
|
||||
props.searchResultsObj.representationsObj
|
||||
}
|
||||
@@ -94,8 +87,7 @@ const CaseHome = (props) => {
|
||||
footerLinks={footerLinks}
|
||||
props={props}
|
||||
ticketnumber={
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.ticketnumber
|
||||
props.currentView.caseReference.currentReference
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
@@ -112,6 +104,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
console.log(cookies);
|
||||
console.log("the query :", query.ticketnumber);
|
||||
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
let thisSession = await getSession(ctx);
|
||||
let loggedInUser = {};
|
||||
|
||||
@@ -124,7 +117,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
loggedInUser = loggedInUser.value[0].contactid;
|
||||
|
||||
const accountDetails = await getPersonalAccount(loggedInUser);
|
||||
store.dispatch(setContainerID(thisSession.user.id));
|
||||
store.dispatch(setAccountDetails(accountDetails));
|
||||
store.dispatch(setLoggedInUserId(loggedInUser));
|
||||
} else {
|
||||
console.log("not has sesssion.......");
|
||||
}
|
||||
@@ -172,6 +167,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
},
|
||||
};
|
||||
} else {
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(
|
||||
setCurrentReference({
|
||||
"ticketnumber": searchResultsObj.value[0].ticketnumber,
|
||||
@@ -180,17 +177,30 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
"incidentid": searchResultsObj.value[0].incidentid,
|
||||
"appealType":
|
||||
searchResultsObj.value[0].pinswg_appealcasetype,
|
||||
"showLoginCheck": showLoginCheck,
|
||||
"specialistProcess":
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_speacialistcaseprocess != null ||
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_specialistcaseprocess != null
|
||||
? searchDetailsObj[0].value[0]
|
||||
.pinswg_speacialistcaseprocess ||
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_specialistcaseprocess
|
||||
: "",
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
// console.log(searchResultsObj);
|
||||
|
||||
console.log(loggedInUser);
|
||||
return {
|
||||
props: {
|
||||
searchResultsObj: {
|
||||
searchResultsObj: searchResultsObj,
|
||||
searchDetailsObj: searchDetailsObj,
|
||||
},
|
||||
// searchResultsObj: {
|
||||
// searchResultsObj: searchResultsObj,
|
||||
// searchDetailsObj: searchDetailsObj,
|
||||
// },
|
||||
currentType: "directResultsObj",
|
||||
},
|
||||
};
|
||||
@@ -202,7 +212,7 @@ const mapStateToProps = (state) => {
|
||||
accountDetails: state.accountDetails,
|
||||
currentView: state.currentView,
|
||||
search: state.search,
|
||||
//searchResultsObj: state.searchResultsObj,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
documentDetailsObj: state.searchResultsObj.documentDetailsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
@@ -219,6 +229,15 @@ const mapDispatchToProps = (dispatch) => {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(refno));
|
||||
},
|
||||
setSearchResults: (searchResults) => {
|
||||
dispatch(setSearchResults(searchResults));
|
||||
},
|
||||
setSearchDetails: (searchDetails) => {
|
||||
dispatch(setSearchDetails(searchDetails));
|
||||
},
|
||||
setLoggedInUserId: (loggedInUser) => {
|
||||
dispatch(setLoggedInUserId(loggedInUser));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user