mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
Working on arthome
This commit is contained in:
@@ -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
|
||||
})
|
||||
7
server/api/categories/index.get.ts
Normal file
7
server/api/categories/index.get.ts
Normal 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),
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user