Commit 8e1da1f3 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

reservation model 수정

parent 344fee7a
...@@ -14,14 +14,11 @@ const PaymentCompletePage = () => { ...@@ -14,14 +14,11 @@ const PaymentCompletePage = () => {
getUserInfo() getUserInfo()
} else { } else {
getGuestInfo() getGuestInfo()
const tid = localStorage.getItem('tid')
approveKakaopay(tid)
} }
}, [user]) }, [user])
useEffect(() => {
const tid = localStorage.getItem('tid')
approveKakaopay(tid)
}, [])
async function getGuestInfo() { async function getGuestInfo() {
try { try {
if (user.id > 0) { if (user.id > 0) {
...@@ -80,13 +77,13 @@ const PaymentCompletePage = () => { ...@@ -80,13 +77,13 @@ const PaymentCompletePage = () => {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const pg_token = urlParams.get('pg_token'); const pg_token = urlParams.get('pg_token');
try { try {
if (user) { if (user.id > 0) {
console.log(user.id) console.log(user.id)
const response = await axios.post(`/api/kakaopay/success`, { const response = await axios.post(`/api/kakaopay/success`, {
'tid': tid, 'tid': tid,
cid: 'TC0ONETIME', cid: 'TC0ONETIME',
partner_order_id: 'butter_studio', partner_order_id: 'butter_studio',
partner_user_id: '000000' + '6', partner_user_id: '000000' + user.id,
pg_token: pg_token pg_token: pg_token
}) })
console.log(response.data) console.log(response.data)
......
...@@ -11,21 +11,18 @@ const ReservationModel = (sequelize) => { ...@@ -11,21 +11,18 @@ const ReservationModel = (sequelize) => {
primaryKey: true, primaryKey: true,
autoIncrement: true, autoIncrement: true,
}, },
tid:{
type: DataTypes.STRING,
},
movieId: { movieId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
}, },
theater: {
type: DataTypes.INTEGER,
},
row: { row: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
}, },
col: { col: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
}, },
timetable:{
type: DataTypes.INTEGER,
},
userType:{ userType:{
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
......
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