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
2133a2a0
Commit
2133a2a0
authored
Aug 07, 2021
by
Jiwon Yoon
Browse files
reservation에 총 금액 넣기
parent
6d72fc1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/src/pages/PaymentPage/PaymentPage.js
View file @
2133a2a0
...
...
@@ -70,7 +70,7 @@ const Payment = ({ location }) => {
if
(
user
.
role
===
"
member
"
)
{
const
response
=
await
axios
.
post
(
`/api/reservation/save`
,
{
userType
:
"
member
"
,
payment
:
"
카카오페이
"
,
//
payment: "카카오페이",
user
:
userInfo
.
id
,
...
ticketInfo
,
timetable
:
1
...
...
@@ -97,7 +97,7 @@ const Payment = ({ location }) => {
userType
:
"
guest
"
,
user
:
guestID
,
...
ticketInfo
,
payment
:
"
카카오페이
"
,
//
payment: "카카오페이",
timetable
:
1
})
const
responsekakao
=
await
axios
.
post
(
'
/api/kakaopay/test/single
'
,
{
...
...
server/controllers/reservation.controller.js
View file @
2133a2a0
...
...
@@ -45,7 +45,7 @@ const findOneReservation = async (req, res) => {
}
}
const
saveReservation
=
async
(
req
,
res
)
=>
{
const
{
movieId
,
selectedTheater
,
timetable
,
payment
,
user
,
userType
}
=
req
.
body
const
{
movieId
,
selectedTheater
,
timetable
,
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
])
try
{
...
...
@@ -58,7 +58,8 @@ const saveReservation = async (req, res) => {
row
:
rows
[
index
],
col
:
cols
[
index
],
timetable
:
timetable
,
payment
:
payment
payment
:
payment
,
totalFee
:
totalFee
})
}
const
movie
=
await
Movie
.
findOne
({
...
...
server/models/reservation.model.js
View file @
2133a2a0
...
...
@@ -34,6 +34,9 @@ const ReservationModel = (sequelize) => {
},
payment
:{
type
:
DataTypes
.
STRING
,
},
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