refactor phase 3a myportal advanced and address search imports

This commit is contained in:
2026-03-12 09:20:33 +00:00
parent cbcb9549be
commit 562cffdc59
2 changed files with 29 additions and 29 deletions
+18 -18
View File
@@ -3,14 +3,14 @@ import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { getIP } from "../../actions/core/logger";
import { getPersonalAccount } from "../../actions/services/accountService";
import { getPortalModuleDetails } from "../../actions/services/caseService";
import {
getAddressSearch,
getAdvancedSearch,
getIP,
getPersonalAccount,
getPortalModuleDetails,
getWatchedCases,
} from "../../actions";
getAdvancedSearch
} from "../../actions/services/searchService";
import { getWatchedCases } from "../../actions/services/portalService";
import SearchResults from "../../components/addresssearchresults";
import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner";
@@ -18,22 +18,22 @@ import Footer from "../../components/footer";
import Header from "../../components/header";
import {
getFormCollectionByID,
getSearchDetails,
getSearchDetails
} from "../../components/utils";
import {
setAccountDetails,
setContainerID,
setLoggedInUserId,
setLoggedInUserId
} from "../../store/accountDetails/action";
import { setShowReps } from "../../store/currentView/action";
import { setSearch } from "../../store/search/action";
import {
setSearchDetails,
setSearchResults,
setSearchResults
} from "../../store/searchOutput/action";
import {
setWatchedCases,
setWatchedCasesDetails,
setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { wrapper } from "../../store/store";
@@ -159,8 +159,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return {
redirect: {
destination: "/auth/signin",
permanent: false,
},
permanent: false
}
};
} else {
thisSession != false &&
@@ -170,12 +170,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
await Promise.all([
await getPersonalAccount(loggedInUser),
await getAdvancedSearch(query),
await getWatchedCases(loggedInUser),
await getWatchedCases(loggedInUser)
]);
const [searchDetailsObj, watchedCasesDetails] = await Promise.all([
await getSearchDetails(searchResultsObj),
await getDetails(watchedCases, "myWatchedCases"),
await getDetails(watchedCases, "myWatchedCases")
]);
store.dispatch(setAccountDetails(accountDetails));
@@ -191,11 +191,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
props: {
searchResultsObj: {
searchResultsObj: searchResultsObj,
searchDetailsObj: searchDetailsObj,
searchDetailsObj: searchDetailsObj
},
currentType: "directResultsObj",
showLoginCheck: showLoginCheck,
},
showLoginCheck: showLoginCheck
}
};
}
);
@@ -241,7 +241,7 @@ const mapStateToProps = (state) => {
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
accountDetails: state.accountDetails,
accountDetails: state.accountDetails
};
};
+11 -11
View File
@@ -4,13 +4,13 @@ import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { getIP } from "../../actions/core/logger";
import { getPersonalAccount } from "../../actions/services/accountService";
import {
getAppealsTypes,
getIP,
getLPA,
getPersonalAccount,
getProjectTypes,
} from "../../actions";
getProjectTypes
} from "../../actions/services/referenceDataService";
import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner";
import CRMError from "../../components/crmError";
@@ -21,7 +21,7 @@ import TimeOut from "../../components/timeout";
import {
setAccountDetails,
setContainerID,
setLoggedInUserId,
setLoggedInUserId
} from "../../store/accountDetails/action";
import { setAppealType, setProjectType } from "../../store/appealType/action";
import { setLPA } from "../../store/lpa/action";
@@ -91,8 +91,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return {
redirect: {
destination: "/auth/signin",
permanent: false,
},
permanent: false
}
};
} else {
const [accountDetails, appealTypeData, lpaData, projectTypeData] =
@@ -100,7 +100,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getPersonalAccount(loggedInUser),
await getAppealsTypes(),
await getLPA(),
await getProjectTypes(),
await getProjectTypes()
]);
//const lpaData = require("../../data/lpa.json");
@@ -117,8 +117,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
}
return {
props: {
showLoginCheck: showLoginCheck,
},
showLoginCheck: showLoginCheck
}
};
}
);
@@ -132,7 +132,7 @@ const mapStateToProps = (state) => {
appealType: state.appealType,
LPAData: state.LPAData,
form: state.form,
accountDetails: state.accountDetails,
accountDetails: state.accountDetails
};
};