Merge pull request #243 from SyncrowIOT/check-if-user-deleted-validation

This commit is contained in:
faris Aljohari
2025-02-04 03:08:30 -06:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@ -181,7 +181,9 @@ export class InviteUserService {
where: { email },
relations: ['project'],
});
if (!user.isActive) {
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
}
if (user?.project) {
throw new HttpException(
'This email already has a project',
@ -193,7 +195,9 @@ export class InviteUserService {
where: { email },
relations: ['project'],
});
if (!invitedUser.isActive) {
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
}
if (invitedUser?.project) {
throw new HttpException(
'This email already has a project',