chore: Änderungen commited

This commit is contained in:
2025-05-10 22:35:14 +02:00
parent 3a20ea0282
commit f292cf1ce5
2 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@@ -326,7 +326,13 @@
const mindmapId = event.currentTarget.dataset.mindmapId; const mindmapId = event.currentTarget.dataset.mindmapId;
if (confirm('Bist du sicher, dass du diese Mindmap löschen möchtest?')) { if (confirm('Bist du sicher, dass du diese Mindmap löschen möchtest?')) {
try { try {
const response = await fetch(`/api/mindmaps/${mindmapId}`, { method: 'DELETE' }); const csrfToken = "{{ csrf_token() }}"; // CSRF Token holen
const response = await fetch(`/api/mindmaps/${mindmapId}`, {
method: 'DELETE',
headers: {
'X-CSRFToken': csrfToken // CSRF Token im Header senden
}
});
if (!response.ok) { if (!response.ok) {
const errorData = await response.json(); const errorData = await response.json();
throw new Error(errorData.error || `HTTP error! status: ${response.status}`); throw new Error(errorData.error || `HTTP error! status: ${response.status}`);