From 9e5278d2760a66c3d8fadadbe45ccf2f09da1130 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 1 Mar 2023 12:02:37 +0900 Subject: [PATCH] fix of #10145 --- packages/backend/src/core/entities/RoleEntityService.ts | 2 +- packages/backend/src/server/api/endpoints/admin/roles/users.ts | 2 +- packages/backend/src/server/api/endpoints/roles/users.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/entities/RoleEntityService.ts b/packages/backend/src/core/entities/RoleEntityService.ts index 4208e03a8..2f1d51fa1 100644 --- a/packages/backend/src/core/entities/RoleEntityService.ts +++ b/packages/backend/src/core/entities/RoleEntityService.ts @@ -32,7 +32,7 @@ export class RoleEntityService { const assignedCount = await this.roleAssignmentsRepository.createQueryBuilder('assign') .where('assign.roleId = :roleId', { roleId: role.id }) .andWhere(new Brackets(qb => { qb - .where('assign.expiresAt IS NOT NULL') + .where('assign.expiresAt IS NULL') .orWhere('assign.expiresAt > :now', { now: new Date() }); })) .getCount(); diff --git a/packages/backend/src/server/api/endpoints/admin/roles/users.ts b/packages/backend/src/server/api/endpoints/admin/roles/users.ts index ec1e86fec..930d3fee4 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/users.ts @@ -58,7 +58,7 @@ export default class extends Endpoint { const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId) .andWhere('assign.roleId = :roleId', { roleId: role.id }) .andWhere(new Brackets(qb => { qb - .where('assign.expiresAt IS NOT NULL') + .where('assign.expiresAt IS NULL') .orWhere('assign.expiresAt > :now', { now: new Date() }); })) .innerJoinAndSelect('assign.user', 'user'); diff --git a/packages/backend/src/server/api/endpoints/roles/users.ts b/packages/backend/src/server/api/endpoints/roles/users.ts index 2a8684e6d..607dc2420 100644 --- a/packages/backend/src/server/api/endpoints/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/roles/users.ts @@ -58,7 +58,7 @@ export default class extends Endpoint { const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId) .andWhere('assign.roleId = :roleId', { roleId: role.id }) .andWhere(new Brackets(qb => { qb - .where('assign.expiresAt IS NOT NULL') + .where('assign.expiresAt IS NULL') .orWhere('assign.expiresAt > :now', { now: new Date() }); })) .innerJoinAndSelect('assign.user', 'user');