fix: working copy, caching ASP, notworking orders though
This commit is contained in:
parent
dc5d204cfc
commit
390ad23e03
32 changed files with 246 additions and 194 deletions
|
@ -62,7 +62,7 @@
|
|||
}
|
||||
);
|
||||
|
||||
window.freq.set('seat-chooser', sc);
|
||||
window.sc = sc;
|
||||
})();
|
||||
|
||||
let total = 0;
|
||||
|
@ -84,13 +84,14 @@ document.querySelector('button#order-button').addEventListener('click', (e) => {
|
|||
window.sc.selectedSeats.forEach(seat => {
|
||||
seats.push({
|
||||
seat: seat.id,
|
||||
ticket: seat.ticket.id
|
||||
price: seat.ticket.id,
|
||||
});
|
||||
});
|
||||
fetch(`/api/order`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + document.querySelector('#order-button').getAttribute('data-token') || ''
|
||||
},
|
||||
body: JSON.stringify({
|
||||
showing: sc.showingId,
|
||||
|
@ -98,7 +99,8 @@ document.querySelector('button#order-button').addEventListener('click', (e) => {
|
|||
})
|
||||
}).then(res => {
|
||||
if (res.ok) {
|
||||
window.location = '/order/complete';
|
||||
// window.location = '/order/complete';
|
||||
console.log('Order placed');
|
||||
} else {
|
||||
alert('Error placing order');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue