Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions frontend/src/js/booking_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ function bindBookingFlow() {

if (!btnCreateOrder) return;

let createdBookingId = sessionStorage.getItem('pendingOrderId');
if (createdBookingId) {
window.location.href = `/payment?orderId=${createdBookingId}`;
return;
}


const seatIds = currentCheckoutData.seats.map(s => parseInt(s.id));
const token = getAuthToken();
Expand Down Expand Up @@ -116,8 +112,7 @@ function bindBookingFlow() {
const createData = await createRes.json();
if (!createRes.ok) throw new Error(createData.message || "Tạo đơn hàng thất bại");

createdBookingId = createData.data.order_id;
sessionStorage.setItem('pendingOrderId', createdBookingId);
let createdBookingId = createData.data.order_id;
sessionStorage.removeItem('checkoutData');

window.location.href = `/payment?orderId=${createdBookingId}`;
Expand Down
1 change: 0 additions & 1 deletion frontend/src/templates/payment.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ <h4 class="mt-3 fw-bold">Thanh toán thành công!</h4>

sessionStorage.setItem('ticketResult', JSON.stringify(result.data));
sessionStorage.removeItem('checkoutData');
sessionStorage.removeItem('pendingOrderId');

setTimeout(() => { window.location.href = "/tickets"; }, 1500);
}
Expand Down
Loading