GameExpo23/TFR/server/static/js/sessions.js
Michał Gdula 26ce573726 Split JS files
Reorganise Accounts page
Shrink filter options on mobile
2023-06-13 00:40:13 +03:00

19 lines
519 B
JavaScript

function yeetSession(id) {
let form = new FormData();
form.append('session_id', 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'));
}