feat: Students list excludes staff by default

This commit is contained in:
2026-07-09 10:07:04 +08:00
parent 14eec2852a
commit 17ef1adcaa

View File

@@ -26,7 +26,8 @@ export class StudentsService {
if (query?.status) { if (query?.status) {
where.status = query.status; where.status = query.status;
} else if (!query?.includeArchived) { } else if (!query?.includeArchived) {
where.status = Not('archived'); // Default: hide archived and staff, unless explicitly queried
where.status = Not(In(['archived', 'staff']));
} }
const filteredWhere = await this.scope.filter(where); const filteredWhere = await this.scope.filter(where);
return this.repo.find({ where: filteredWhere, order: { createdAt: 'DESC' }, relations: ['tenant'] }); return this.repo.find({ where: filteredWhere, order: { createdAt: 'DESC' }, relations: ['tenant'] });