debug seat status incorrect after rendering
by seatsio
HTML
<script src="https://cdn.seatsio.net/chart.js"></script>
<div id="chart"></div>
CSS
#chart {
height: 500px;
}
JavaScript
const workspaceKey = 'dd65ab2d-8746-4696-b8db-81b21de17e67';
const event = '4142';
const secretKey = '2f9b05b7-07f5-4e15-be6d-5701afc443a4';
function renderChart(holdToken) {
var chart = new seatsio.SeatingChart({
workspaceKey,
event,
session: "manual",
holdToken
}).render();
}
function holdObjects(holdToken) {
const url = 'https://api-na.seatsio.net/events/' + event + '/actions/hold'
return fetch(url, {
'method': 'POST',
'headers': {
'Authorization': 'Basic ' + btoa(secretKey + ':')
},
'body': JSON.stringify({
bestAvailable: { number: 4 },
holdToken: holdToken
})
})
}
async function createHoldToken() {
const url = 'https://api-na.seatsio.net/hold-tokens'
let result = await fetch(url, {
'method': 'POST',
'headers': {
'Authorization': 'Basic ' + btoa(secretKey + ':')
}
})
let json = await result.json()
return json.holdToken
}
async function main() {
const holdToken = await createHoldToken()
await holdObjects(holdToken)
renderChart(holdToken)
}
main()