mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 02:15:21 +00:00
Add roleType relation and debug logs in InviteUserService
This commit is contained in:
@ -208,7 +208,7 @@ export class InviteUserService {
|
||||
status: UserStatusEnum.INVITED,
|
||||
isActive: true,
|
||||
},
|
||||
relations: ['project', 'spaces.space.community'],
|
||||
relations: ['project', 'spaces.space.community', 'roleType'],
|
||||
});
|
||||
|
||||
if (!invitedUser) {
|
||||
@ -245,10 +245,26 @@ export class InviteUserService {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
'invitedUser',
|
||||
invitedUser,
|
||||
{ uuid: invitedUser.uuid },
|
||||
{ status: UserStatusEnum.ACTIVE },
|
||||
);
|
||||
|
||||
await this.inviteUserRepository.update(
|
||||
{ uuid: invitedUser.uuid },
|
||||
{ status: UserStatusEnum.ACTIVE },
|
||||
);
|
||||
console.log('test', {
|
||||
project: { uuid: invitedUser.project.uuid },
|
||||
});
|
||||
console.log('test2', {
|
||||
inviteUser: { uuid: invitedUser.uuid },
|
||||
});
|
||||
console.log('test3', {
|
||||
roleType: { uuid: invitedUser.roleType.uuid },
|
||||
});
|
||||
await this.userRepository.update(
|
||||
{ uuid: userUuid },
|
||||
{
|
||||
@ -554,6 +570,7 @@ export class InviteUserService {
|
||||
if (!userData) {
|
||||
throw new HttpException('User not found', HttpStatus.NOT_FOUND);
|
||||
}
|
||||
console.log('userData', userData);
|
||||
|
||||
if (userData.status === UserStatusEnum.INVITED) {
|
||||
await this.updateUserStatus(invitedUserUuid, projectUuid, disable);
|
||||
@ -562,6 +579,7 @@ export class InviteUserService {
|
||||
where: { inviteUser: { uuid: invitedUserUuid } },
|
||||
relations: ['userSpaces.space', 'userSpaces.space.community'],
|
||||
});
|
||||
console.log('user', user);
|
||||
|
||||
if (!user) {
|
||||
throw new HttpException(
|
||||
|
Reference in New Issue
Block a user