Commit 28b903fe authored by Kim, Subin's avatar Kim, Subin
Browse files

일반 search 완성

parent 89ada388
...@@ -33,7 +33,6 @@ const search = async (title) => { ...@@ -33,7 +33,6 @@ const search = async (title) => {
} }
} }
const { data } = await axios.get(`${baseUrl}/api/movie/search`, payload) const { data } = await axios.get(`${baseUrl}/api/movie/search`, payload)
console.log("server recive==", data)
return data return data
} }
......
...@@ -18,14 +18,13 @@ const SearchResult = () => { ...@@ -18,14 +18,13 @@ const SearchResult = () => {
async function findforKeyword() { async function findforKeyword() {
try { try {
setError("") setError("")
const data = await movieApi.search(title) const { count, rows } = await movieApi.search(title)
setResult([...data]) setResult([...rows])
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
} }
} }
console.log("search==", search, "title==", title)
return ( return (
<> <>
{result.length !== 0 ? ( {result.length !== 0 ? (
......
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