Fix JS fetch credentials and CSV export from web UI

This commit is contained in:
2026-07-16 18:32:37 +07:00
parent 677f6028d9
commit 8e62eaf3f3
6 changed files with 41 additions and 9 deletions
+2 -2
View File
@@ -36,7 +36,7 @@
{% block scripts %}
<script>
async function markRead(id) {
const res = await fetch(`/api/notifications/${id}/read`, { method: 'POST' });
const res = await fetch(`/api/notifications/${id}/read`, { method: 'POST', credentials: 'include' });
if (res.ok) location.reload();
}
@@ -45,7 +45,7 @@ document.querySelectorAll('.mark-read').forEach(btn => {
});
document.getElementById('mark-all-read')?.addEventListener('click', async () => {
const res = await fetch('/api/notifications/read-all', { method: 'POST' });
const res = await fetch('/api/notifications/read-all', { method: 'POST', credentials: 'include' });
if (res.ok) location.reload();
});
</script>