mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 18:52:06 +00:00
27 lines
672 B
TypeScript
27 lines
672 B
TypeScript
import GetUserSchema from '@/services/User/schema/GetUserSchema';
|
|
import DBClient from '@/prisma/DBClient';
|
|
import { z } from 'zod';
|
|
|
|
const updateUserToBeConfirmedById = async (id: string) => {
|
|
const user: z.infer<typeof GetUserSchema> = await DBClient.instance.user.update({
|
|
where: { id },
|
|
data: { accountIsVerified: true, updatedAt: new Date() },
|
|
select: {
|
|
id: true,
|
|
username: true,
|
|
email: true,
|
|
accountIsVerified: true,
|
|
createdAt: true,
|
|
firstName: true,
|
|
lastName: true,
|
|
updatedAt: true,
|
|
dateOfBirth: true,
|
|
role: true,
|
|
},
|
|
});
|
|
|
|
return user;
|
|
};
|
|
|
|
export default updateUserToBeConfirmedById;
|