This commit is contained in:
syuilo
2023-06-10 17:41:52 +09:00
parent c59a30ec09
commit 46222d0258
9 changed files with 5 additions and 36 deletions

View File

@@ -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);
});

View File

@@ -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 })