Commit 2133a2a0 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

reservation에 총 금액 넣기

parent 6d72fc1e
......@@ -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', {
......
......@@ -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({
......
......@@ -34,6 +34,9 @@ const ReservationModel = (sequelize) => {
},
payment:{
type: DataTypes.STRING,
},
totalFee:{
type: DataTypes.INTEGER,
}
},
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment