mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-10-25 14:07:55 +00:00
feat: add localization to expection messages
This commit is contained in:
@@ -26,7 +26,7 @@ export class UserService {
|
||||
|
||||
if (!user) {
|
||||
this.logger.error(`User with not found with where clause ${JSON.stringify(where)}`);
|
||||
throw new BadRequestException('USERS.NOT_FOUND');
|
||||
throw new BadRequestException('USER.NOT_FOUND');
|
||||
}
|
||||
|
||||
this.logger.log(`User with where clause ${JSON.stringify(where)} found successfully`);
|
||||
@@ -43,12 +43,12 @@ export class UserService {
|
||||
}
|
||||
if (user && user.roles.includes(Roles.GUARDIAN) && user.isProfileCompleted) {
|
||||
this.logger.error(`User with phone number ${phoneNumber} already exists`);
|
||||
throw new BadRequestException('USERS.PHONE_NUMBER_ALREADY_EXISTS');
|
||||
throw new BadRequestException('USER.PHONE_NUMBER_ALREADY_EXISTS');
|
||||
}
|
||||
|
||||
if (user && user.roles.includes(Roles.JUNIOR)) {
|
||||
this.logger.error(`User with phone number ${phoneNumber} is an already registered junior`);
|
||||
throw new BadRequestException('USERS.JUNIOR_UPGRADE_NOT_SUPPORTED_YET');
|
||||
throw new BadRequestException('USER.JUNIOR_UPGRADE_NOT_SUPPORTED_YET');
|
||||
//TODO add role Guardian to the existing user and send OTP
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user