refactor(nestjs): replace the reports endpoints

This commit is contained in:
Ahmed Bouhuolia
2025-05-09 18:55:16 +02:00
parent 3c8b7c92fe
commit 7506c2f37f
24 changed files with 82 additions and 62 deletions

View File

@@ -92,7 +92,10 @@ export class AuthSignupService {
const isEmailExists = await this.systemUserModel.query().findOne({ email });
if (isEmailExists) {
throw new ServiceError(ERRORS.EMAIL_EXISTS);
throw new ServiceError(
ERRORS.EMAIL_EXISTS,
'The given email address is already signed-up',
);
}
}
@@ -120,11 +123,17 @@ export class AuthSignupService {
);
if (!isAllowedEmail && !isAllowedDomain) {
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED_NOT_ALLOWED);
throw new ServiceError(
ERRORS.SIGNUP_RESTRICTED_NOT_ALLOWED,
'The given email address format is not allowed to signup.',
);
}
// Throw error if the signup is disabled with no exceptions.
} else {
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED);
throw new ServiceError(
ERRORS.SIGNUP_RESTRICTED,
'The sign-up is disabled',
);
}
}
}