added garys api endpoint
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
setSearchResults,
|
||||
getSearchResultsObj,
|
||||
} from "../store/searchOutput/action";
|
||||
import { getBasicSearch } from "../actions";
|
||||
import { getToken, getBasicSearch } from "../actions";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
@@ -56,6 +56,8 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) =>
|
||||
async ({ query, req, res }) => {
|
||||
const token = await getToken();
|
||||
console.log(token);
|
||||
console.log("query-", query);
|
||||
const searchResultsObj = (await getBasicSearch(query.q)) || null;
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
|
||||
Reference in New Issue
Block a user