Merge pull request #3 from HamzaSha1/feat/user-registration

Feat/user registration
This commit is contained in:
abdalhamid99
2024-12-05 11:50:36 +03:00
committed by GitHub

View File

@ -73,6 +73,12 @@ export class AuthService {
throw new BadRequestException('USERS.EMAIL_ALREADY_SET'); throw new BadRequestException('USERS.EMAIL_ALREADY_SET');
} }
const existingUser = await this.userService.findUser({ email });
if (existingUser) {
throw new BadRequestException('USERS.EMAIL_ALREADY_TAKEN');
}
return this.userService.setEmail(userId, email); return this.userService.setEmail(userId, email);
} }