Commit 7d3fd5c0 authored by Kim, Subin's avatar Kim, Subin
Browse files

movieApi - getfromTm

parent 404e124a
import axios from "axios"; import axios from "axios";
import { baseUrl, TMDBUrl } from "../utils/baseUrl"; import { baseUrl, TMDBUrl } from "../utils/baseUrl";
const getUpcomingfromTM = async () => { const getfromTM = async (category) => {
const { data } = await axios.get(`${TMDBUrl}/upcoming?api_key=${process.env.REACT_APP_TMDB_API_KEY}&language=ko-KR`) const response = await axios.get(`${baseUrl}/api/movie/showmovie/${category}`)
return data.results return response.data
} }
const submit = async (movieId) => { const submit = async (movieId) => {
const { data } = await axios.post(`${baseUrl}/api/movie/${movieId}`) const { data } = await axios.post(`${baseUrl}/api/movie/${movieId}`)
console.log("data==",data) console.log("data==", data)
} }
const movieApi = { const movieApi = {
getUpcomingfromTM, getfromTM,
submit submit
} }
......
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