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