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
})