refactor phase 3a pages-dns targeted actions imports
This commit is contained in:
+13
-15
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { getDNSList } from "../../actions";
|
||||
import { getDNSList } from "../../actions/services/searchService";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
import Main from "../../components/dns//main";
|
||||
import Footer from "../../components/footer";
|
||||
@@ -15,7 +15,7 @@ import { getSearchDetails } from "../../components/utils";
|
||||
import { setSearch } from "../../store/search/action";
|
||||
import {
|
||||
setSearchDetails,
|
||||
setSearchResults,
|
||||
setSearchResults
|
||||
} from "../../store/searchOutput/action";
|
||||
|
||||
const Home = (props) => {
|
||||
@@ -64,8 +64,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
redirect: {
|
||||
//destination: "/dns-not-found",
|
||||
destination: "/error",
|
||||
permanent: false,
|
||||
},
|
||||
permanent: false
|
||||
}
|
||||
};
|
||||
} else {
|
||||
searchResultsObj =
|
||||
@@ -73,21 +73,19 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
errorMsg: searchResultsObj.statusText
|
||||
}
|
||||
: searchResultsObj;
|
||||
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
const searchDetailsObj =
|
||||
await getSearchDetails(searchResultsObj);
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch("DNS"));
|
||||
}
|
||||
} else {
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
const searchDetailsObj =
|
||||
await getSearchDetails(searchResultsObj);
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch("DNS"));
|
||||
@@ -95,9 +93,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
return {
|
||||
props: {
|
||||
searchResultsObj: {
|
||||
searchResultsObj: searchResultsObj,
|
||||
},
|
||||
},
|
||||
searchResultsObj: searchResultsObj
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -113,7 +111,7 @@ const mapStateToProps = (state) => {
|
||||
myCases: state.myCases,
|
||||
watchedCases: state.watchedCases,
|
||||
myRepresentations: state.myRepresentations,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
awaitingSubmission: state.awaitingSubmission
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user