Fix DELETE request body serialization for news deletion

This commit is contained in:
Torsten Schulz (local)
2025-10-21 14:50:05 +02:00
parent 55a70a1c98
commit 196955f7c4
11 changed files with 170 additions and 203 deletions

View File

@@ -237,12 +237,16 @@ const confirmDelete = async (item) => {
try {
await $fetch('/api/news', {
method: 'DELETE',
body: { id: item.id }
body: JSON.stringify({ id: item.id }),
headers: {
'Content-Type': 'application/json'
}
})
await loadNews()
} catch (error) {
alert('Fehler beim Löschen der News.')
console.error('Delete error:', error)
alert('Fehler beim Löschen der News: ' + (error.data?.message || error.message))
}
}