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
bc3ee7b9
Commit
bc3ee7b9
authored
Aug 09, 2021
by
Jiwon Yoon
Browse files
오류수정 및 reservation
parent
31cef7c3
Changes
12
Show whitespace changes
Inline
Side-by-side
client/src/components/Collection.js
View file @
bc3ee7b9
...
...
@@ -29,7 +29,7 @@ const Collection = ({ TMDB_TopRated_Data }) => {
?
<
div
className
=
""
>
<
div
className
=
"
ratio ratio-16x9
"
>
<
iframe
src
=
{
`https://www.youtube.com/embed/
${
videoUrls
[
0
].
key
}
`
}
title
=
"
YouTube video
"
allow
f
ull
s
creen
><
/iframe
>
<
iframe
src
=
{
`https://www.youtube.com/embed/
${
videoUrls
[
0
].
key
}
`
}
title
=
"
YouTube video
"
allow
F
ull
S
creen
><
/iframe
>
<
/div
>
<
/div
>
...
...
client/src/components/TheaterInfo.js
View file @
bc3ee7b9
import
{
useRef
,
useState
,
useEffect
}
from
'
react
'
import
cinemaApi
from
"
../apis/cinema.api
,
js
"
import
cinemaApi
from
"
../apis/cinema.api
.
js
"
import
theaterApi
from
"
../apis/theater.api.js
"
import
catchErrors
from
"
../utils/catchErrors
"
...
...
client/src/components/TicketingMovie/TicketingMovie.js
View file @
bc3ee7b9
...
...
@@ -2,8 +2,6 @@ import { useState, useEffect } from 'react'
import
movieApi
from
'
../../apis/movie.api
'
import
catchErrors
from
'
../../utils/catchErrors
'
import
styles
from
"
./ticketingMovie.module.scss
"
import
movieApi
from
'
../../apis/movie.api
'
import
catchErrors
from
'
../../utils/catchErrors
'
const
TicketingMovie
=
({
ticketInfo
,
setTicketInfo
})
=>
{
const
[
movieList
,
setMovieList
]
=
useState
([])
...
...
client/src/components/Video.js
View file @
bc3ee7b9
...
...
@@ -26,7 +26,7 @@ const Video = ({ movieId }) => {
<
div
className
=
"
mt-5 pb-5
"
>
<
p
>
{
el
.
name
}
<
/p
>
<
div
class
=
"
ratio ratio-16x9
"
>
<
iframe
src
=
{
`https://www.youtube.com/embed/
${
el
.
key
}
`
}
title
=
"
YouTube video
"
allow
f
ull
s
creen
><
/iframe
>
<
iframe
src
=
{
`https://www.youtube.com/embed/
${
el
.
key
}
`
}
title
=
"
YouTube video
"
allow
F
ull
S
creen
><
/iframe
>
<
/div
>
<
/div
>
))
...
...
client/src/pages/PaymentCompletePage.js
View file @
bc3ee7b9
...
...
@@ -25,15 +25,11 @@ const PaymentCompletePage = () => {
async
function
saveGuestReservation
()
{
try
{
const
response
=
await
axios
.
get
(
`/api/auth/guestinfo/
${
user
.
id
}
`
);
// const response2 = await reservationApi.save({
// userType: "guest",
// user: user.id,
// ...paymentData,
// timetableId: 1
// })
// if (response.data) {
const
response2
=
await
reservationApi
.
findOneReservation
()
console
.
log
(
"
예매내역=====
"
,
response2
)
// if (response.data||response2) {
// const responseEmail = await axios.post('/api/email/send', {
// reservationData:
[...
response2
.data]
,
// reservationData: response2,
// userData: { ...response.data },
// cinema: "Butter Studio 조치원",
// title: "더 수어사이드 스쿼드",
...
...
@@ -42,7 +38,6 @@ const PaymentCompletePage = () => {
// })
// console.log(responseEmail.data)
// }
console
.
log
(
response
.
data
)
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
}
...
...
client/src/pages/PaymentPage/PaymentPage.js
View file @
bc3ee7b9
...
...
@@ -113,7 +113,7 @@ const Payment = ({ location }) => {
fail_url
:
'
http://localhost:3000/ticket
'
,
cancel_url
:
'
http://localhost:3000/ticket
'
,
})
if
(
responsekakao
)
{
if
(
response
||
responsekakao
)
{
localStorage
.
setItem
(
'
tid
'
,
responsekakao
.
data
.
tid
)
window
.
location
.
href
=
responsekakao
.
data
.
redirect_url
}
...
...
@@ -129,6 +129,7 @@ const Payment = ({ location }) => {
return
(
<
div
className
=
"
container
"
style
=
{{
color
:
"
white
"
}}
>
{
console
.
log
(
ticketInfo
)}
<
div
className
=
"
row justify-content-center my-5
"
>
<
div
className
=
"
col-sm-4
"
>
<
h3
className
=
"
py-2 text-white text-center
"
style
=
{{
border
:
"
3px solid #000000
"
,
borderBottom
:
"
3px solid #FEDC00
"
}}
>
결제하기
<
/h3
>
...
...
client/src/pages/TicketingPage.js
View file @
bc3ee7b9
...
...
@@ -12,7 +12,7 @@ const TicketingPage = ({ location }) => {
const
[
ticketInfo
,
setTicketInfo
]
=
useState
({
...
location
.
state
,
cinema
:
""
,
selectedTheater
:
"
1
"
,
selectedTheater
:
1
,
time
:
"
2021/07/21 10:00
"
})
const
[
cinemaInfo
,
setCinemaInfo
]
=
useState
({})
...
...
client/src/pages/TicketingSeatPage.js
View file @
bc3ee7b9
...
...
@@ -40,12 +40,13 @@ const TicketingSeatPage = ({ location }) => {
async
function
getInfo
()
{
try
{
setError
(
""
)
const
response
=
await
axios
.
post
(
'
/api/theater/getInfo
'
,
{
theaterId
:
ticketInfo
.
selectedTheater
})
setTheaterInfo
(
response
.
data
)
const
response2
=
await
reservationApi
.
findReservedSeats
(
1
);
const
reserve
=
response2
.
data
.
map
((
el
)
=>
const
reserve
=
response2
.
map
((
el
)
=>
el
.
row
+
'
-
'
+
el
.
col
);
setReservedSeats
(
reserve
);
...
...
@@ -56,6 +57,7 @@ const TicketingSeatPage = ({ location }) => {
async
function
getTicketFee
()
{
try
{
setError
(
""
)
const
response3
=
await
axios
.
get
(
`/api/info/ticketfee`
,
{
params
:
{
theaterTypeId
:
theaterInfo
.
theatertypeId
...
...
server/controllers/reservation.controller.js
View file @
bc3ee7b9
...
...
@@ -5,7 +5,7 @@ import config from '../config/app.config.js'
const
findReservedSeats
=
async
(
req
,
res
)
=>
{
try
{
const
{
timeTable
}
=
req
.
body
console
.
log
(
"
타임테이블===============
"
,
timeTable
)
console
.
log
(
"
타임테이블===============
"
,
timeTable
)
const
reservedSeats
=
await
Reservation
.
findAll
({
where
:
{
timetableId
:
timeTable
...
...
@@ -51,7 +51,7 @@ const findOneReservation = async (req, res, next) => {
}
const
saveReservation
=
async
(
req
,
res
)
=>
{
try
{
const
{
movieId
,
selectedTheater
,
timetable
,
payment
,
user
,
userType
,
totalFee
}
=
req
.
body
const
{
movieId
,
selectedTheater
,
timetable
Id
,
payment
,
user
,
userType
,
totalFee
}
=
req
.
body
const
rows
=
req
.
body
.
selectedSeats
.
map
(
el
=>
el
.
split
(
'
-
'
)[
0
])
const
cols
=
req
.
body
.
selectedSeats
.
map
(
el
=>
el
.
split
(
'
-
'
)[
1
])
for
(
let
index
=
0
;
index
<
rows
.
length
;
index
++
)
{
...
...
@@ -59,10 +59,10 @@ const saveReservation = async (req, res) => {
user
:
user
,
userType
:
userType
,
movieId
:
movieId
,
theaterId
:
selectedTheater
,
row
:
rows
[
index
],
col
:
cols
[
index
],
timetableId
:
timetable
,
timetableId
:
timetableId
,
theaterId
:
selectedTheater
,
payment
:
payment
,
totalFee
:
totalFee
,
})
...
...
server/controllers/user.controller.js
View file @
bc3ee7b9
...
...
@@ -472,7 +472,7 @@ const saveGuestInfo = async (req, res) => {
roleId
:
1
});
res
.
clearCookie
(
config
.
cookieName
);
const
token
=
jwt
.
sign
({
id
:
newGuest
.
id
,
role
:
"
user
"
},
config
.
jwtSecret
,
{
const
token
=
jwt
.
sign
({
id
:
newGuest
.
id
,
role
:
"
guest
"
},
config
.
jwtSecret
,
{
expiresIn
:
config
.
jwtExpires
,
});
res
.
cookie
(
config
.
cookieName
,
token
,
{
...
...
server/models/reservation.model.js
View file @
bc3ee7b9
...
...
@@ -11,9 +11,6 @@ const ReservationModel = (sequelize) => {
primaryKey
:
true
,
autoIncrement
:
true
,
},
tid
:{
type
:
DataTypes
.
STRING
,
},
movieId
:
{
type
:
DataTypes
.
INTEGER
,
},
...
...
server/routes/user.route.js
View file @
bc3ee7b9
import
express
from
"
express
"
;
import
multer
from
"
multer
"
;
import
userCtrl
from
"
../controllers/user.controller.js
"
;
import
multer
from
"
multer
"
const
router
=
express
.
Router
();
const
upload
=
multer
({
dest
:
"
upload/
"
})
router
.
route
(
"
/user
"
)
.
get
(
userCtrl
.
getUser
)
const
upload
=
multer
({
dest
:
"
upload/
"
})
router
.
route
(
"
/user
"
)
.
get
(
userCtrl
.
getUser
)
...
...
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