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

reservation model 수정

parent 344fee7a
...@@ -14,13 +14,10 @@ const PaymentCompletePage = () => { ...@@ -14,13 +14,10 @@ const PaymentCompletePage = () => {
getUserInfo() getUserInfo()
} else { } else {
getGuestInfo() getGuestInfo()
}
}, [user])
useEffect(() => {
const tid = localStorage.getItem('tid') const tid = localStorage.getItem('tid')
approveKakaopay(tid) approveKakaopay(tid)
}, []) }
}, [user])
async function getGuestInfo() { async function getGuestInfo() {
try { try {
...@@ -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,10 +11,10 @@ const ReservationModel = (sequelize) => { ...@@ -11,10 +11,10 @@ const ReservationModel = (sequelize) => {
primaryKey: true, primaryKey: true,
autoIncrement: true, autoIncrement: true,
}, },
movieId: { tid:{
type: DataTypes.INTEGER, type: DataTypes.STRING,
}, },
theater: { movieId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
}, },
row: { row: {
...@@ -23,9 +23,6 @@ const ReservationModel = (sequelize) => { ...@@ -23,9 +23,6 @@ const ReservationModel = (sequelize) => {
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