fixes
This commit is contained in:
@@ -94,11 +94,7 @@ describe('AdminUsersService', () => {
|
||||
},
|
||||
manager,
|
||||
);
|
||||
expect(lockedUserQuery.setLock).toHaveBeenCalledWith(
|
||||
'pessimistic_write',
|
||||
undefined,
|
||||
['lockedUser'],
|
||||
);
|
||||
expect(lockedUserQuery.setLock).toHaveBeenCalledWith('pessimistic_write');
|
||||
expect(lockedUserQuery.leftJoinAndSelect).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
@@ -122,11 +118,7 @@ describe('AdminUsersService', () => {
|
||||
service.updateRole(actorId, target.id, RoleEnum.user),
|
||||
).rejects.toBeInstanceOf(ConflictException);
|
||||
|
||||
expect(lockQuery.setLock).toHaveBeenCalledWith(
|
||||
'pessimistic_write',
|
||||
undefined,
|
||||
['user'],
|
||||
);
|
||||
expect(lockQuery.setLock).toHaveBeenCalledWith('pessimistic_write');
|
||||
expect(dataSource.transaction).toHaveBeenCalledTimes(1);
|
||||
expect(userRepository.save).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -269,7 +269,7 @@ export class AdminUsersService {
|
||||
.andWhere('status.id = :activeStatus', {
|
||||
activeStatus: StatusEnum.active,
|
||||
})
|
||||
.setLock('pessimistic_write', undefined, ['user'])
|
||||
.setLock('pessimistic_write')
|
||||
.orderBy('user.id', 'ASC')
|
||||
.getMany();
|
||||
}
|
||||
@@ -283,7 +283,7 @@ export class AdminUsersService {
|
||||
.leftJoinAndSelect('lockedUser.role', 'role')
|
||||
.leftJoinAndSelect('lockedUser.status', 'status')
|
||||
.where('lockedUser.id = :userId', { userId })
|
||||
.setLock('pessimistic_write', undefined, ['lockedUser'])
|
||||
.setLock('pessimistic_write')
|
||||
.getOne();
|
||||
if (!user) throw new NotFoundException('User not found');
|
||||
return user;
|
||||
|
||||
Reference in New Issue
Block a user