mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
26 lines
588 B
TypeScript
26 lines
588 B
TypeScript
import DBClient from '@/prisma/DBClient';
|
|
import { z } from 'zod';
|
|
import GetUserSchema from './schema/GetUserSchema';
|
|
|
|
const findUserById = async (id: string) => {
|
|
const user: z.infer<typeof GetUserSchema> | null =
|
|
await DBClient.instance.user.findUnique({
|
|
where: { id },
|
|
select: {
|
|
id: true,
|
|
username: true,
|
|
email: true,
|
|
firstName: true,
|
|
lastName: true,
|
|
dateOfBirth: true,
|
|
createdAt: true,
|
|
accountIsVerified: true,
|
|
updatedAt: true
|
|
},
|
|
});
|
|
|
|
return user;
|
|
};
|
|
|
|
export default findUserById;
|