added some mocked data calls
This commit is contained in:
@@ -15,7 +15,7 @@ import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
import { setSearch, getSearchObj } from "../store/search/action";
|
||||
|
||||
import { setSearchResults, getSearchResultsObj } from "../store/searchOutput/action";
|
||||
import {getBasicSearch} from "../actions"
|
||||
|
||||
const Home = (props) => {
|
||||
@@ -37,7 +37,7 @@ const Home = (props) => {
|
||||
<Header courseName={t("common:service-name")} />
|
||||
<div className="govuk-width-container">
|
||||
<Banner />
|
||||
<SearchResults searchString={props.search.searchString} />
|
||||
<SearchResults searchString={props.search.searchString} searchResultsObj={props.searchResultsObj} />
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
</div>
|
||||
@@ -49,7 +49,8 @@ export const getServerSideProps = wrapper.getServerSideProps (
|
||||
store => async({ query, req, res }) =>
|
||||
{
|
||||
console.log('query-',query);
|
||||
const searchResults = await getBasicSearch(query.q)
|
||||
const searchResultsObj = await getBasicSearch(query.q) || null;
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
}
|
||||
);
|
||||
@@ -81,6 +82,7 @@ const mapStateToProps = (state) => {
|
||||
|
||||
return {
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj
|
||||
// // apiroot: state.apiroot,
|
||||
// // courseListContent: state.courseListContent.courseListContent,
|
||||
// // pages: state.pages.pages,
|
||||
|
||||
Reference in New Issue
Block a user