lint code

Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2024-04-20 00:18:43 +02:00
parent c6ba8c791b
commit c698bfec8a
44 changed files with 180 additions and 177 deletions

View File

@@ -5,12 +5,12 @@ const PostSchema = z.object({ slug: z.string() }).parse
export default defineEventHandler(async (event) => {
const { slug } = await readValidatedBody(event, PostSchema)
return useDB().insert(tables.posts).values({
slug
slug,
}).onConflictDoUpdate({
target: tables.posts.id,
set: {
views: sql`${tables.posts.views}
+ 1`
}
+ 1`,
},
})
})