diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index 746505e..69a2189 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -124,7 +124,7 @@ export const fetchComicVineMatches = (searchPayload) => (dispatch) => { axios .request({ - url: "http://localhost:3080/api/comicvine/fetchseries", + url: "http://localhost:3080/api/comicvine/fetchresource", method: "POST", data: { format: "json", diff --git a/src/client/components/Search.tsx b/src/client/components/Search.tsx index ad7cb5b..79f1461 100644 --- a/src/client/components/Search.tsx +++ b/src/client/components/Search.tsx @@ -1,4 +1,4 @@ -import React, { useMemo, ReactElement } from "react"; +import React, { useMemo, useCallback, ReactElement } from "react"; import { removeLeadingPeriod, escapePoundSymbol, @@ -7,11 +7,28 @@ import { useTable } from "react-table"; import prettyBytes from "pretty-bytes"; import ellipsize from "ellipsize"; -import { useSelector } from "react-redux"; +import { useSelector, useDispatch } from "react-redux"; +import { comicinfoAPICall } from "../actions/comicinfo.actions"; interface ISearchProps {} export const Search = ({}: ISearchProps): ReactElement => { + const dispatch = useDispatch(); + const getCVSearchResults = useCallback(() => { + dispatch( + comicinfoAPICall({ + callURIAction: "search", + method: "GET", + params: { + api_key: "a5fa0663683df8145a85d694b5da4b87e1c92c69", + format: "json", + limit: "10", + offset: "0", + field_list: "id,name,deck,api_detail_url", + }, + }), + ); + }, [dispatch]); return ( <>