Enhance news component functionality and UI; implement dynamic grid layout in PublicNews.vue, add visibility and expiration options in news management, and update API to handle new fields for improved news filtering and display.
This commit is contained in:
@@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
const body = await readBody(event)
|
||||
const { id, title, content, isPublic } = body
|
||||
const { id, title, content, isPublic, expiresAt, isHidden } = body
|
||||
|
||||
if (!title || !content) {
|
||||
throw createError({
|
||||
@@ -46,6 +46,8 @@ export default defineEventHandler(async (event) => {
|
||||
title,
|
||||
content,
|
||||
isPublic: isPublic || false,
|
||||
expiresAt: expiresAt || undefined,
|
||||
isHidden: isHidden || false,
|
||||
author: user.name
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user