movie.api.js 491 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import axios from "axios";
import { baseUrl, TMDBUrl } from "../utils/baseUrl";

const getUpcomingfromTM = async () => {
    const { data } = await axios.get(`${TMDBUrl}/upcoming?api_key=${process.env.REACT_APP_TMDB_API_KEY}&language=ko-KR`)
    return data.results
}

const submit = async (movieId) => {
    const { data } = await axios.post(`${baseUrl}/api/movie/${movieId}`)
    console.log("data==",data)
}

const movieApi = {
    getUpcomingfromTM,
    submit
}

export default movieApi