Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
♻️ Use prisma directly not authService
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Oct 27, 2020
1 parent 21b09bb commit 62d6ae0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ export class AuthService {
ignorePwnedPassword,
);

const users = await this.users.users({
take: 1,
const testUser = await this.prisma.users.findFirst({
where: { emails: { some: { emailSafe } } },
});
if (users.length)
if (testUser)
throw new HttpException(
'A user with this email already exists',
HttpStatus.CONFLICT,
Expand Down

0 comments on commit 62d6ae0

Please sign in to comment.