From 562cffdc59b83bde6d0d6d1c137f43fce203ffd6 Mon Sep 17 00:00:00 2001 From: robbond Date: Thu, 12 Mar 2026 09:20:33 +0000 Subject: [PATCH] refactor phase 3a myportal advanced and address search imports --- pages/myportal/addresssearchresults.js | 36 +++++++++++++------------- pages/myportal/advancedsearch.js | 22 ++++++++-------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pages/myportal/addresssearchresults.js b/pages/myportal/addresssearchresults.js index 6a95c69b..ed58f06b 100644 --- a/pages/myportal/addresssearchresults.js +++ b/pages/myportal/addresssearchresults.js @@ -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 }; }; diff --git a/pages/myportal/advancedsearch.js b/pages/myportal/advancedsearch.js index bced25e7..773034c1 100644 --- a/pages/myportal/advancedsearch.js +++ b/pages/myportal/advancedsearch.js @@ -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 }; };