added in basic api request
This commit is contained in:
@@ -16,6 +16,8 @@ import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
import { setSearch, getSearchObj } from "../store/search/action";
|
||||
|
||||
import {getBasicSearch} from "../actions"
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
@@ -43,11 +45,12 @@ const Home = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) =>
|
||||
({ req, res, query }) => {
|
||||
console.log(query);
|
||||
store.dispatch(setSearch(query.q));
|
||||
export const getServerSideProps = wrapper.getServerSideProps (
|
||||
store => async({ query, req, res }) =>
|
||||
{
|
||||
console.log('query-',query);
|
||||
const searchResults = await getBasicSearch(query.q)
|
||||
store.dispatch(setSearch(query.q));
|
||||
}
|
||||
);
|
||||
|
||||
@@ -74,7 +77,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
// );
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
console.log(state);
|
||||
console.log('mapstate',state);
|
||||
|
||||
return {
|
||||
search: state.search,
|
||||
|
||||
Reference in New Issue
Block a user