Commit a7e6bbcf authored by Kim, Subin's avatar Kim, Subin
Browse files

client search

parent 48405aa5
......@@ -3,7 +3,7 @@ import { useHistory } from "react-router";
import Search from "../Search";
const MainNav = () => {
const [search, setSearch] = useState({ keyword: "" })
const [search, setSearch] = useState({ type: "home", keyword: "" })
const history = useHistory()
function searchMovie() {
......@@ -15,7 +15,7 @@ const MainNav = () => {
<a class="nav-link text-white" href="/movielist">영화</a>
<a class="nav-link text-white" href="/ticket">빠른예매</a>
<a class="nav-link text-white" href="#">극장</a>
<Search type="home" search={search} setSearch={setSearch} handleClick={searchMovie} />
<Search search={search} setSearch={setSearch} handleClick={searchMovie} />
</nav>
)
}
......
......@@ -18,7 +18,7 @@ const SearchResult = () => {
async function findforKeyword() {
try {
setError("")
const { count, results } = await movieApi.search(title)
const { count, results } = await movieApi.search({ type: "home", keyword: title })
setResult([...results])
} catch (error) {
catchErrors(error, setError)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment