Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
butter-studio
Commits
7d3fd5c0
Commit
7d3fd5c0
authored
Jul 19, 2021
by
Kim, Subin
Browse files
movieApi - getfromTm
parent
404e124a
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/apis/movie.api.js
View file @
7d3fd5c0
import
axios
from
"
axios
"
;
import
{
baseUrl
,
TMDBUrl
}
from
"
../utils/baseUrl
"
;
const
get
Upcoming
fromTM
=
async
()
=>
{
const
{
data
}
=
await
axios
.
get
(
`
${
TMDB
Url
}
/
upcoming?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
&language=ko-KR
`
)
return
data
.
results
const
getfromTM
=
async
(
category
)
=>
{
const
response
=
await
axios
.
get
(
`
${
base
Url
}
/
api/movie/showmovie/
${
category
}
`
)
return
response
.
data
}
const
submit
=
async
(
movieId
)
=>
{
const
{
data
}
=
await
axios
.
post
(
`
${
baseUrl
}
/api/movie/
${
movieId
}
`
)
console
.
log
(
"
data==
"
,
data
)
console
.
log
(
"
data==
"
,
data
)
}
const
movieApi
=
{
get
Upcoming
fromTM
,
getfromTM
,
submit
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment