fix: harden permission-gated UI — minimum-org endpoint, modal/Popconfirm fail-closed on revocation

This commit is contained in:
2026-07-23 14:15:52 +08:00
parent f39136d9ce
commit 3ac99b808e
11 changed files with 282 additions and 142 deletions

View File

@@ -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('机构不存在');