Fix missing ID generation for new news items and add IDs to existing entries
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { d as defineEventHandler, g as getCookie, c as createError, r as readBody } from '../../nitro/nitro.mjs';
|
||||
import { d as defineEventHandler, g as getCookie, c as createError, b as getQuery } from '../../nitro/nitro.mjs';
|
||||
import { b as verifyToken, e as getUserById } from '../../_/auth.mjs';
|
||||
import { d as deleteNews } from '../../_/news.mjs';
|
||||
import 'node:http';
|
||||
@@ -37,8 +37,8 @@ const news_delete = defineEventHandler(async (event) => {
|
||||
message: "Keine Berechtigung zum L\xF6schen von News."
|
||||
});
|
||||
}
|
||||
const body = await readBody(event);
|
||||
const { id } = body;
|
||||
const query = getQuery(event);
|
||||
const id = query.id;
|
||||
if (!id) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
|
||||
Reference in New Issue
Block a user