Use query params instead of body for DELETE request
This commit is contained in:
@@ -31,8 +31,9 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
}
|
||||
|
||||
const body = await readBody(event)
|
||||
const { id } = body
|
||||
// Get ID from query params for DELETE requests
|
||||
const query = getQuery(event)
|
||||
const id = query.id
|
||||
|
||||
if (!id) {
|
||||
throw createError({
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
[
|
||||
{
|
||||
"title": "aaa",
|
||||
"content": "bbb",
|
||||
"author": "Admin",
|
||||
"created": "2025-10-21T13:08:56.050Z",
|
||||
"updated": "2025-10-21T13:08:56.050Z"
|
||||
},
|
||||
{
|
||||
"title": "Alles neu",
|
||||
"content": "Die seite ist brandneu",
|
||||
|
||||
Reference in New Issue
Block a user