Fix JS fetch credentials and CSV export from web UI
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user