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
889bac06
Commit
889bac06
authored
Jul 31, 2021
by
Kim, Subin
Browse files
console.log 삭제 및 getListfromDB 추가
parent
d6d0949f
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/apis/movie.api.js
View file @
889bac06
...
@@ -10,23 +10,24 @@ const getAllfromTM = async () => {
...
@@ -10,23 +10,24 @@ const getAllfromTM = async () => {
const
{
data
}
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie/all`
,
payload
)
const
{
data
}
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie/all`
,
payload
)
return
data
return
data
}
}
const
getMoviesfromTM
=
async
(
category
)
=>
{
const
getMoviesfromTM
=
async
(
category
)
=>
{
console
.
log
(
category
)
const
response
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie/showmovies/
${
category
}
`
)
const
response
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie/showmovies/
${
category
}
`
)
console
.
log
(
response
.
data
)
return
response
.
data
return
response
.
data
}
}
const
getMovieInfofromTM
=
async
(
id
)
=>
{
const
getMovieInfofromTM
=
async
(
id
)
=>
{
const
movieId
=
id
const
movieId
=
id
const
response
=
await
axios
.
get
(
`
${
TMDBUrl
}
/
${
movieId
}
?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
&language=ko-KR`
)
const
response
=
await
axios
.
get
(
`
${
TMDBUrl
}
/
${
movieId
}
?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
&language=ko-KR`
)
console
.
log
(
response
.
data
)
return
response
.
data
return
response
.
data
}
}
const
getImagesfromTM
=
async
(
id
)
=>
{
const
getImagesfromTM
=
async
(
id
)
=>
{
const
movieId
=
id
const
movieId
=
id
const
response
=
await
axios
.
get
(
`
${
TMDBUrl
}
/
${
movieId
}
/images?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
`
)
const
response
=
await
axios
.
get
(
`
${
TMDBUrl
}
/
${
movieId
}
/images?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
`
)
return
response
.
data
return
response
.
data
}
}
const
getCreditsfromTM
=
async
(
id
)
=>
{
const
getCreditsfromTM
=
async
(
id
)
=>
{
const
movieId
=
id
const
movieId
=
id
const
response
=
await
axios
.
get
(
`
${
TMDBUrl
}
/
${
movieId
}
/credits?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
`
)
const
response
=
await
axios
.
get
(
`
${
TMDBUrl
}
/
${
movieId
}
/credits?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
`
)
...
@@ -39,9 +40,14 @@ const getVideosfromTM = async (id) =>{
...
@@ -39,9 +40,14 @@ const getVideosfromTM = async (id) =>{
return
response
.
data
.
results
return
response
.
data
.
results
}
}
const
getListfromDB
=
async
()
=>
{
const
{
data
}
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie`
)
return
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
)
return
data
}
}
const
remove
=
async
(
movieId
)
=>
{
const
remove
=
async
(
movieId
)
=>
{
...
@@ -66,6 +72,7 @@ const movieApi = {
...
@@ -66,6 +72,7 @@ const movieApi = {
getImagesfromTM
,
getImagesfromTM
,
getCreditsfromTM
,
getCreditsfromTM
,
getVideosfromTM
,
getVideosfromTM
,
getListfromDB
,
submit
,
submit
,
remove
,
remove
,
search
,
search
,
...
...
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