tweak of f3a16bcd6
This commit is contained in:
parent
c59a30ec09
commit
46222d0258
9 changed files with 5 additions and 36 deletions
|
|
@ -30,6 +30,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
super(meta, paramDef, async (ps, me) => {
|
||||
const roles = await this.rolesRepository.findBy({
|
||||
isPublic: true,
|
||||
isExplorable: true,
|
||||
});
|
||||
return await this.roleEntityService.packMany(roles, me);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -49,14 +49,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
const role = await this.rolesRepository.findOneBy({
|
||||
id: ps.roleId,
|
||||
isPublic: true,
|
||||
isExplorable: true,
|
||||
});
|
||||
|
||||
if (role == null) {
|
||||
throw new ApiError(meta.errors.noSuchRole);
|
||||
}
|
||||
if (!role.isPublicUsers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
|
||||
.andWhere('assign.roleId = :roleId', { roleId: role.id })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue