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
432e3eb3
Commit
432e3eb3
authored
Aug 10, 2021
by
Jiwon Yoon
Browse files
reservation
parent
bc3ee7b9
Changes
7
Hide whitespace changes
Inline
Side-by-side
client/src/components/TheaterInfo.js
View file @
432e3eb3
...
...
@@ -53,14 +53,15 @@ const TheaterInfo = () => {
try
{
const
response
=
await
cinemaApi
.
getCinemaInfo
()
const
response2
=
await
theaterApi
.
getAll
()
setCinemaInfo
({
...
response
.
data
,
theaterNum
:
response2
.
data
.
length
})
setCinemaInfo
({
...
response
,
theaterNum
:
response2
.
length
})
setCurrentInfo
({
name
:
"
대중교통 안내
"
,
title
:
"
transportation
"
,
information
:
response
.
data
.
transportation
information
:
response
.
transportation
})
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
console
.
log
(
error
)
}
}
...
...
client/src/components/TicketingTheater/TicketingTheater.js
View file @
432e3eb3
...
...
@@ -8,7 +8,12 @@ const TicketingTheater = ({ ticketInfo, cinemaInfo, setTicketInfo }) => {
return
(
<
div
className
=
"
d-grid gap-2
"
>
<
button
name
=
{
cinemaInfo
.
cinemaName
}
className
=
{
`
${
ticketInfo
.
cinema
===
cinemaInfo
.
cinemaName
?
styles
.
on
:
styles
.
btn
}
`
}
onClick
=
{
handleClick
}
>
{
cinemaInfo
.
cinemaName
}
<
/button
>
{
cinemaInfo
?
<
button
name
=
{
cinemaInfo
.
cinemaName
}
className
=
{
`
${
ticketInfo
.
cinema
===
cinemaInfo
.
cinemaName
?
styles
.
on
:
styles
.
btn
}
`
}
onClick
=
{
handleClick
}
>
{
cinemaInfo
.
cinemaName
}
<
/button
>
:
<><
/
>
}
<
/div
>
)
}
...
...
client/src/pages/PaymentCompletePage.js
View file @
432e3eb3
import
axios
from
'
axios
'
import
{
useEffect
,
useState
}
from
'
react
'
import
axios
from
'
axios
'
import
moment
from
'
moment
'
;
import
{
useAuth
}
from
'
../context/auth_context
'
import
catchErrors
from
'
../utils/catchErrors
'
import
reservationApi
from
'
../apis/reservation.api
'
...
...
@@ -26,18 +27,18 @@ const PaymentCompletePage = () => {
try
{
const
response
=
await
axios
.
get
(
`/api/auth/guestinfo/
${
user
.
id
}
`
);
const
response2
=
await
reservationApi
.
findOneReservation
()
console
.
log
(
"
예매내역=====
"
,
response2
)
//
if (response.data||response2) {
//
const responseEmail = await axios.post('/api/email/send', {
//
reservationData: response2,
//
userData: { ...response.data },
//
cinema: "Butter Studio 조치원",
//
title:
"더 수어사이드 스쿼드"
,
//
theater:
"1"
,
//
time:
"2021/07/21 10:00"
//
})
//
console.log(responseEmail.data)
//
}
console
.
log
(
"
예매내역=====
"
,
response2
)
if
(
response
.
data
||
response2
)
{
const
responseEmail
=
await
axios
.
post
(
'
/api/email/send
'
,
{
reservationData
:
response2
.
map
(
el
=>
{
return
{
"
row
"
:
el
.
row
,
"
col
"
:
el
.
col
}
})
,
userData
:
{
...
response
.
data
},
cinema
:
"
Butter Studio 조치원
"
,
title
:
response2
[
0
].
title
,
theater
:
response2
[
0
].
theater
.
theaterName
,
time
:
response2
[
0
].
timetable
.
date
.
split
(
'
T
'
)[
0
]
+
'
'
+
moment
(
response2
[
0
].
timetable
.
start_time
).
format
(
'
HH:mm
'
)
})
console
.
log
(
responseEmail
.
data
)
}
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
}
...
...
client/src/pages/PaymentPage/PaymentPage.js
View file @
432e3eb3
...
...
@@ -129,7 +129,6 @@ 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 @
432e3eb3
...
...
@@ -10,6 +10,7 @@ import catchErrors from "../utils/catchErrors.js"
const
TicketingPage
=
({
location
})
=>
{
const
[
ticketInfo
,
setTicketInfo
]
=
useState
({
movieId
:
0
,
...
location
.
state
,
cinema
:
""
,
selectedTheater
:
1
,
...
...
@@ -24,11 +25,9 @@ const TicketingPage = ({ location }) => {
},
[])
useEffect
(()
=>
{
getCinemaInfo
()
},
[])
useEffect
(()
=>
{
getMovieInfo
()
if
(
ticketInfo
.
movieId
>
0
)
{
getMovieInfo
()
}
},
[
ticketInfo
])
async
function
getMovieInfo
()
{
...
...
@@ -54,7 +53,7 @@ const TicketingPage = ({ location }) => {
console
.
log
(
response
.
data
)
setCinemaInfo
(
response
.
data
)
}
catch
(
error
)
{
c
onsole
.
log
(
e
rror
)
c
atchErrors
(
error
,
setE
rror
)
}
}
return
(
...
...
server/index.js
View file @
432e3eb3
...
...
@@ -10,7 +10,7 @@ dotenv.config({
});
sequelize
.
sync
({
force
:
fals
e
})
.
sync
({
force
:
tru
e
})
.
then
(
async
()
=>
{
await
Promise
.
all
(
Object
.
keys
(
ROLE_NAME
).
map
((
name
)
=>
{
...
...
server/models/reservation.model.js
View file @
432e3eb3
...
...
@@ -11,25 +11,28 @@ const ReservationModel = (sequelize) => {
primaryKey
:
true
,
autoIncrement
:
true
,
},
// reservationNum: {
// type: DataTypes.INTEGER,
// },
movieId
:
{
type
:
DataTypes
.
INTEGER
,
},
},
row
:
{
type
:
DataTypes
.
INTEGER
,
},
col
:
{
type
:
DataTypes
.
INTEGER
,
},
userType
:{
userType
:
{
type
:
DataTypes
.
STRING
,
},
user
:{
user
:
{
type
:
DataTypes
.
INTEGER
,
},
payment
:{
payment
:
{
type
:
DataTypes
.
STRING
,
},
totalFee
:{
totalFee
:
{
type
:
DataTypes
.
INTEGER
,
}
},
...
...
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