File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1- import { client } from "@/lib/utils " ;
1+ import { verifyUniqueEmail } from "./user.service " ;
22
33// Se mantiene para hacer la validación de correo electrónico en el registro del lado del cliente
44export async function findEmail ( email : string ) : Promise < boolean > {
5- const body = await client < boolean > ( "/users/findEmail" , {
6- body : { email } ,
7- } ) ;
8-
9- return body ;
5+ return verifyUniqueEmail ( email ) ;
106}
Original file line number Diff line number Diff line change @@ -48,3 +48,11 @@ export async function getOrCreateUser(email: string): Promise<User> {
4848
4949 return existingUser ;
5050}
51+
52+ export async function verifyUniqueEmail ( email : string ) : Promise < boolean > {
53+ const user = await prisma . user . findUnique ( {
54+ where : { email } ,
55+ } ) ;
56+
57+ return user ? true : false ;
58+ }
You can’t perform that action at this time.
0 commit comments