régler problème de dispos des coachs

This commit is contained in:
cedrick2711
2026-08-10 17:20:07 -04:00
parent bb0bc1c192
commit d007900f6c
5 changed files with 27 additions and 17 deletions
+8 -2
View File
@@ -357,7 +357,10 @@ function saveCoachAvailability() {
}
fetch('{{ url_for("users.manage_coach_availability") }}', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': '{{ csrf_token() }}'
},
body: JSON.stringify({ slots: slots })
})
.then(r => r.json())
@@ -376,7 +379,10 @@ function saveCoachAvailability() {
function clearAllAvailability() {
if (!confirm('Are you sure you want to clear all your availability slots?')) return;
fetch('{{ url_for("users.clear_coach_availability") }}', { method: 'POST' })
fetch('{{ url_for("users.clear_coach_availability") }}', {
method: 'POST',
headers: { 'X-CSRFToken': '{{ csrf_token() }}' }
})
.then(r => r.json())
.then(data => {
if (data.success) {