Fix delete fetch: add credentials same-origin
This commit is contained in:
parent
04eaac3094
commit
595451428a
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue