movie.api.js 447 Bytes
Newer Older
1
2
3
import axios from "axios";
import { baseUrl, TMDBUrl } from "../utils/baseUrl";

Kim, Subin's avatar
Kim, Subin committed
4
5
6
const getfromTM = async (category) => {
    const response = await axios.get(`${baseUrl}/api/movie/showmovie/${category}`)
    return response.data
7
8
9
10
}

const submit = async (movieId) => {
    const { data } = await axios.post(`${baseUrl}/api/movie/${movieId}`)
Kim, Subin's avatar
Kim, Subin committed
11
    console.log("data==", data)
12
13
14
}

const movieApi = {
Kim, Subin's avatar
Kim, Subin committed
15
    getfromTM,
16
17
18
19
    submit
}

export default movieApi