mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-05-13 17:21:53 +00:00
Update index.ts
Took 2 minutes
This commit is contained in:
@@ -35,8 +35,10 @@ async function createUser(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
async function readUser(req: NextApiRequest, res: NextApiResponse) {
|
||||
const {id} = req.query as {id: string}
|
||||
|
||||
const user = (req.query.id)
|
||||
? await prisma.user.findUnique({where: {id: req.query.id}})
|
||||
? await prisma.user.findUnique({where: {id}})
|
||||
: await prisma.user.findMany()
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user