Fix isPublic field not being saved when creating/editing news

This commit is contained in:
Torsten Schulz (local)
2025-10-21 15:53:56 +02:00
parent af6cc8c90a
commit 201de0a278
25 changed files with 156 additions and 155 deletions

View File

@@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
}
const body = await readBody(event)
const { id, title, content } = body
const { id, title, content, isPublic } = body
if (!title || !content) {
throw createError({
@@ -45,6 +45,7 @@ export default defineEventHandler(async (event) => {
id: id || undefined,
title,
content,
isPublic: isPublic || false,
author: user.name
})

View File

@@ -6,7 +6,7 @@
"author": "Admin",
"isPublic": false,
"created": "2025-10-21T13:34:28.915Z",
"updated": "2025-10-21T13:34:28.915Z"
"updated": "2025-10-21T13:53:16.820Z"
},
{
"id": "660e8400-e29b-41d4-a716-446655440002",