Fix delete fetch: add credentials same-origin

This commit is contained in:
eric 2026-02-23 08:55:15 +00:00
parent 04eaac3094
commit 595451428a

View file

@ -237,7 +237,7 @@ document.addEventListener('click', function(e) {
if (!btn) return; if (!btn) return;
const id = btn.dataset.id; const id = btn.dataset.id;
if (!confirm('Eintrag #' + id + ' aus dem Log löschen?')) return; if (!confirm('Eintrag #' + id + ' aus dem Log löschen?')) return;
fetch('/api/sent-emails/' + id + '/delete', {method: 'POST'}) fetch('/api/sent-emails/' + id + '/delete', {method: 'POST', credentials: 'same-origin'})
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); }) .then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
.then(d => { .then(d => {
if (d.success) { if (d.success) {