mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 18:13:09 +02:00
fix of #10145
This commit is contained in:
parent
064a6bf065
commit
9e5278d276
3 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ export class RoleEntityService {
|
||||||
const assignedCount = await this.roleAssignmentsRepository.createQueryBuilder('assign')
|
const assignedCount = await this.roleAssignmentsRepository.createQueryBuilder('assign')
|
||||||
.where('assign.roleId = :roleId', { roleId: role.id })
|
.where('assign.roleId = :roleId', { roleId: role.id })
|
||||||
.andWhere(new Brackets(qb => { qb
|
.andWhere(new Brackets(qb => { qb
|
||||||
.where('assign.expiresAt IS NOT NULL')
|
.where('assign.expiresAt IS NULL')
|
||||||
.orWhere('assign.expiresAt > :now', { now: new Date() });
|
.orWhere('assign.expiresAt > :now', { now: new Date() });
|
||||||
}))
|
}))
|
||||||
.getCount();
|
.getCount();
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
|
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
|
||||||
.andWhere('assign.roleId = :roleId', { roleId: role.id })
|
.andWhere('assign.roleId = :roleId', { roleId: role.id })
|
||||||
.andWhere(new Brackets(qb => { qb
|
.andWhere(new Brackets(qb => { qb
|
||||||
.where('assign.expiresAt IS NOT NULL')
|
.where('assign.expiresAt IS NULL')
|
||||||
.orWhere('assign.expiresAt > :now', { now: new Date() });
|
.orWhere('assign.expiresAt > :now', { now: new Date() });
|
||||||
}))
|
}))
|
||||||
.innerJoinAndSelect('assign.user', 'user');
|
.innerJoinAndSelect('assign.user', 'user');
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
|
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
|
||||||
.andWhere('assign.roleId = :roleId', { roleId: role.id })
|
.andWhere('assign.roleId = :roleId', { roleId: role.id })
|
||||||
.andWhere(new Brackets(qb => { qb
|
.andWhere(new Brackets(qb => { qb
|
||||||
.where('assign.expiresAt IS NOT NULL')
|
.where('assign.expiresAt IS NULL')
|
||||||
.orWhere('assign.expiresAt > :now', { now: new Date() });
|
.orWhere('assign.expiresAt > :now', { now: new Date() });
|
||||||
}))
|
}))
|
||||||
.innerJoinAndSelect('assign.user', 'user');
|
.innerJoinAndSelect('assign.user', 'user');
|
||||||
|
|
Loading…
Reference in a new issue