Fix isPublic field not being saved when creating/editing news
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user