mirror of
https://github.com/Fluffy-Bean/GameExpo23.git
synced 2025-05-14 14:22:16 +00:00
19 lines
518 B
JavaScript
19 lines
518 B
JavaScript
function yeetSession(id) {
|
|
const form = new FormData();
|
|
form.append('session', id);
|
|
|
|
fetch('/api/tokens', {
|
|
method: 'POST',
|
|
body: form,
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
addFlashMessage(data.success, 'success');
|
|
document.querySelector(`#sess-${id}`).remove();
|
|
} else {
|
|
addFlashMessage(data.error, 'error');
|
|
}
|
|
})
|
|
.catch(error => addFlashMessage(error.error, 'error'));
|
|
}
|