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
5f60aebc
Commit
5f60aebc
authored
Jul 19, 2021
by
Jiwon Yoon
Browse files
movie apis
parent
711c9c42
Changes
4
Show whitespace changes
Inline
Side-by-side
client/src/apis/movie.api.js
View file @
5f60aebc
...
@@ -5,6 +5,12 @@ const getUpcomingfromTM = async () => {
...
@@ -5,6 +5,12 @@ const getUpcomingfromTM = async () => {
const
{
data
}
=
await
axios
.
get
(
`
${
TMDBUrl
}
/upcoming?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
&language=ko-KR`
)
const
{
data
}
=
await
axios
.
get
(
`
${
TMDBUrl
}
/upcoming?api_key=
${
process
.
env
.
REACT_APP_TMDB_API_KEY
}
&language=ko-KR`
)
return
data
.
results
return
data
.
results
}
}
const
getfromTM
=
async
(
cate
)
=>
{
const
category
=
cate
const
response
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie/showmovie/
${
category
}
`
)
console
.
log
(
response
.
data
)
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
}
`
)
...
@@ -13,6 +19,7 @@ const submit = async (movieId) => {
...
@@ -13,6 +19,7 @@ const submit = async (movieId) => {
const
movieApi
=
{
const
movieApi
=
{
getUpcomingfromTM
,
getUpcomingfromTM
,
getfromTM
,
submit
submit
}
}
...
...
client/src/components/MovieChart/MovieChart.js
View file @
5f60aebc
import
React
,
{
useState
,
useEffect
}
from
'
react
'
import
{
useState
,
useEffect
}
from
'
react
'
import
axios
from
'
axios
'
import
movieApi
from
'
../../apis/movie.api.js
'
import
{
baseUrl
}
from
'
../../utils/baseUrl.js
'
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
styles
from
"
./movieChart.module.scss
"
import
styles
from
"
./movieChart.module.scss
"
...
@@ -11,11 +10,11 @@ const MovieChart = () => {
...
@@ -11,11 +10,11 @@ const MovieChart = () => {
},
[])
},
[])
async
function
getTMDB_TopRated
()
{
async
function
getTMDB_TopRated
()
{
const
category
=
"
popular
"
const
category
=
"
popular
"
try
{
try
{
const
response
=
await
axios
.
get
(
`
${
baseUrl
}
/api/movie/showmovie/
${
category
}
`
)
const
data
=
await
movieApi
.
getfromTM
(
category
)
console
.
log
(
response
.
data
)
console
.
log
(
data
)
setTMDB_TopRated_Data
(
[...
response
.
data
]
)
setTMDB_TopRated_Data
(
data
)
}
catch
(
error
)
{
}
catch
(
error
)
{
}
}
...
...
client/src/components/TicketingTheater/TicketingTheater.js
View file @
5f60aebc
import
React
from
'
react
'
import
styles
from
"
./ticketingTheater.module.scss
"
import
styles
from
"
./ticketingTheater.module.scss
"
const
TicketingTheater
=
(
props
)
=>
{
const
TicketingTheater
=
(
props
)
=>
{
...
...
client/src/pages/TicketingPage.js
View file @
5f60aebc
import
React
,
{
useState
}
from
'
react
'
import
{
useState
}
from
'
react
'
import
TicketingMovie
from
"
../components/TicketingMovie/TicketingMovie
"
import
TicketingMovie
from
"
../components/TicketingMovie/TicketingMovie
"
import
TicketingTheater
from
"
../components/TicketingTheater/TicketingTheater
"
import
TicketingTheater
from
"
../components/TicketingTheater/TicketingTheater
"
import
TicketingTimeTable
from
"
../components/TicketingTimeTable
"
import
TicketingTimeTable
from
"
../components/TicketingTimeTable
"
...
...
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