Working on arthome

This commit is contained in:
2024-08-25 18:33:37 +02:00
parent a5120d006a
commit a1e31a89a7
49 changed files with 3139 additions and 284 deletions

View File

@@ -1,10 +0,0 @@
import { useValidatedBody, z } from 'h3-zod'
export default defineEventHandler(async (event) => {
const users = await useDB().select().from(tables.users).all()
const { email } = await useValidatedBody(event, {
email: z.string(),
})
const user = users.find(user => user.email === email)
return !!user
})

View File

@@ -0,0 +1,7 @@
export default defineEventHandler(async (event) => {
const user = await getUserSession(event)
console.log('session', user)
return useDrizzle().query.categories.findMany({
where: eq(tables.users.id, user.id),
})
})