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

reservation에 총 금액 넣기

parent 6d72fc1e
...@@ -70,7 +70,7 @@ const Payment = ({ location }) => { ...@@ -70,7 +70,7 @@ const Payment = ({ location }) => {
if (user.role === "member") { if (user.role === "member") {
const response = await axios.post(`/api/reservation/save`, { const response = await axios.post(`/api/reservation/save`, {
userType: "member", userType: "member",
payment: "카카오페이", // payment: "카카오페이",
user: userInfo.id, user: userInfo.id,
...ticketInfo, ...ticketInfo,
timetable: 1 timetable: 1
...@@ -97,7 +97,7 @@ const Payment = ({ location }) => { ...@@ -97,7 +97,7 @@ const Payment = ({ location }) => {
userType: "guest", userType: "guest",
user: guestID, user: guestID,
...ticketInfo, ...ticketInfo,
payment: "카카오페이", // payment: "카카오페이",
timetable: 1 timetable: 1
}) })
const responsekakao = await axios.post('/api/kakaopay/test/single', { const responsekakao = await axios.post('/api/kakaopay/test/single', {
......
...@@ -45,7 +45,7 @@ const findOneReservation = async (req, res) => { ...@@ -45,7 +45,7 @@ const findOneReservation = async (req, res) => {
} }
} }
const saveReservation = 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 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])
try { try {
...@@ -58,7 +58,8 @@ const saveReservation = async (req, res) => { ...@@ -58,7 +58,8 @@ const saveReservation = async (req, res) => {
row: rows[index], row: rows[index],
col: cols[index], col: cols[index],
timetable: timetable, timetable: timetable,
payment: payment payment: payment,
totalFee: totalFee
}) })
} }
const movie = await Movie.findOne({ const movie = await Movie.findOne({
......
...@@ -34,6 +34,9 @@ const ReservationModel = (sequelize) => { ...@@ -34,6 +34,9 @@ const ReservationModel = (sequelize) => {
}, },
payment:{ payment:{
type: DataTypes.STRING, 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