chore: Änderungen commited
This commit is contained in:
Binary file not shown.
@@ -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}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user