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

글등록버튼 삭제 및 서버연결

parent 71e6442e
...@@ -7,7 +7,7 @@ import catchErrors from "../../utils/catchErrors.js"; ...@@ -7,7 +7,7 @@ import catchErrors from "../../utils/catchErrors.js";
import styles from "./admin.module.scss"; import styles from "./admin.module.scss";
const MovieEdit = () => { const MovieEdit = () => {
const [search, setSearch] = useState({ kind: "", keyword: "" }) const [search, setSearch] = useState({ type: "admin", keyword: "" })
const [movieList, setMovieList] = useState([]) const [movieList, setMovieList] = useState([])
const [error, setError] = useState("") const [error, setError] = useState("")
...@@ -28,6 +28,8 @@ const MovieEdit = () => { ...@@ -28,6 +28,8 @@ const MovieEdit = () => {
async function searchMovie() { async function searchMovie() {
try { try {
setError("") setError("")
const findMovie = await movieApi.search(search)
setMovieList(findMovie)
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
} }
...@@ -35,17 +37,11 @@ const MovieEdit = () => { ...@@ -35,17 +37,11 @@ const MovieEdit = () => {
return ( return (
<> <>
{console.log("search==",search)}
<div className="d-flex justify-content-md-end justify-content-center mb-3"> <div className="d-flex justify-content-md-end justify-content-center mb-3">
<Search type="admin" search={search} setSearch={setSearch} handleClick={searchMovie} /> <Search search={search} setSearch={setSearch} handleClick={searchMovie} />
</div> </div>
<MovieTable movieList={movieList} /> <MovieTable movieList={movieList} />
<div className="d-flex flex-wrap">
<Pagination /> <Pagination />
<div className="d-flex justify-content-end col-12 col-md-4 my-2">
<button type="button" className={`btn btn-dark ${styles.customBtn}`}>등록</button>
</div>
</div>
</> </>
) )
} }
......
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