mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 08:17:55 +00:00
Refactor update logic for invited users
This commit is contained in:
@@ -289,12 +289,9 @@ export class InviteUserService {
|
||||
|
||||
// Perform update actions if status is 'INVITED'
|
||||
if (userOldData.status === UserStatusEnum.INVITED) {
|
||||
await this.updateWhenUserIsInviteOrDisable(
|
||||
queryRunner,
|
||||
dto,
|
||||
invitedUserUuid,
|
||||
);
|
||||
await this.updateWhenUserIsInvite(queryRunner, dto, invitedUserUuid);
|
||||
} else if (userOldData.status === UserStatusEnum.ACTIVE) {
|
||||
await this.updateWhenUserIsInvite(queryRunner, dto, invitedUserUuid);
|
||||
await this.updateWhenUserIsActive(queryRunner, dto, invitedUserUuid);
|
||||
}
|
||||
|
||||
@@ -320,7 +317,7 @@ export class InviteUserService {
|
||||
}
|
||||
}
|
||||
|
||||
private async updateWhenUserIsInviteOrDisable(
|
||||
private async updateWhenUserIsInvite(
|
||||
queryRunner: QueryRunner,
|
||||
dto: UpdateUserInvitationDto,
|
||||
invitedUserUuid: string,
|
||||
|
||||
Reference in New Issue
Block a user