mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 06:34:54 +00:00
Merge pull request #246 from SyncrowIOT/fix-null-user-issue
Add optional chaining to user and invitedUser checks
This commit is contained in:
@ -181,7 +181,7 @@ export class InviteUserService {
|
|||||||
where: { email },
|
where: { email },
|
||||||
relations: ['project'],
|
relations: ['project'],
|
||||||
});
|
});
|
||||||
if (!user.isActive) {
|
if (!user?.isActive) {
|
||||||
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
|
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
if (user?.project) {
|
if (user?.project) {
|
||||||
@ -195,7 +195,7 @@ export class InviteUserService {
|
|||||||
where: { email },
|
where: { email },
|
||||||
relations: ['project'],
|
relations: ['project'],
|
||||||
});
|
});
|
||||||
if (!invitedUser.isActive) {
|
if (!invitedUser?.isActive) {
|
||||||
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
|
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
if (invitedUser?.project) {
|
if (invitedUser?.project) {
|
||||||
|
|||||||
Reference in New Issue
Block a user