mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 08:07: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'
|
// Perform update actions if status is 'INVITED'
|
||||||
if (userOldData.status === UserStatusEnum.INVITED) {
|
if (userOldData.status === UserStatusEnum.INVITED) {
|
||||||
await this.updateWhenUserIsInviteOrDisable(
|
await this.updateWhenUserIsInvite(queryRunner, dto, invitedUserUuid);
|
||||||
queryRunner,
|
|
||||||
dto,
|
|
||||||
invitedUserUuid,
|
|
||||||
);
|
|
||||||
} else if (userOldData.status === UserStatusEnum.ACTIVE) {
|
} else if (userOldData.status === UserStatusEnum.ACTIVE) {
|
||||||
|
await this.updateWhenUserIsInvite(queryRunner, dto, invitedUserUuid);
|
||||||
await this.updateWhenUserIsActive(queryRunner, dto, invitedUserUuid);
|
await this.updateWhenUserIsActive(queryRunner, dto, invitedUserUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +317,7 @@ export class InviteUserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateWhenUserIsInviteOrDisable(
|
private async updateWhenUserIsInvite(
|
||||||
queryRunner: QueryRunner,
|
queryRunner: QueryRunner,
|
||||||
dto: UpdateUserInvitationDto,
|
dto: UpdateUserInvitationDto,
|
||||||
invitedUserUuid: string,
|
invitedUserUuid: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user