File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
server/api/users/[userId]/notifications Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,15 @@ export default defineEventHandler(async (event) => {
9
9
const queryRestrict = { user_id : userId }
10
10
const { updateNotificationById } = useNotificationCrud ( queryRestrict )
11
11
12
- const body = await readValidatedBody ( event , createInsertSchema ( sysNotificationTable ) . partial ( ) . parse )
12
+ const body = await readBody ( event )
13
13
14
14
if ( body && body . read_at ) {
15
15
body . read_at = new Date ( body . read_at )
16
16
}
17
17
18
- const data = await updateNotificationById ( notificationUId , body )
18
+ const validatedBody = createInsertSchema ( sysNotificationTable ) . partial ( ) . parse ( body )
19
+
20
+ const data = await updateNotificationById ( notificationUId , validatedBody )
19
21
20
22
setResponseStatus ( event , 200 )
21
23
You can’t perform that action at this time.
0 commit comments