fix: harden permission-gated UI — minimum-org endpoint, modal/Popconfirm fail-closed on revocation
This commit is contained in:
@@ -30,6 +30,14 @@ export class OrganizationsService {
|
||||
return this.repo.find({ where, order: { isHost: 'DESC', name: 'ASC' } });
|
||||
}
|
||||
|
||||
async findOptions() {
|
||||
return this.repo.find({
|
||||
select: ['id', 'name', 'isHost'] as const,
|
||||
where: { status: 'active' },
|
||||
order: { isHost: 'DESC' as const, name: 'ASC' as const },
|
||||
});
|
||||
}
|
||||
|
||||
async findOne(id: number) {
|
||||
const organization = await this.repo.findOne({ where: { id } });
|
||||
if (!organization) throw new NotFoundException('机构不存在');
|
||||
|
||||
Reference in New Issue
Block a user