diff --git a/apps/server/src/students/students.service.ts b/apps/server/src/students/students.service.ts index 1b5168e..8955fd1 100644 --- a/apps/server/src/students/students.service.ts +++ b/apps/server/src/students/students.service.ts @@ -1,7 +1,6 @@ import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository, Like, Not, In, FindOptionsWhere } from 'typeorm'; -import { CampusScope } from '../common/campus-scope'; import { Student } from '../entities/student.entity'; import { Class } from '../entities/class.entity'; import { ClassStudent } from '../entities/class-student.entity'; @@ -16,7 +15,6 @@ export class StudentsService { @InjectRepository(ClassStudent) private classStudentRepo: Repository, @InjectRepository(Class) private classRepo: Repository, @InjectRepository(AttendanceRecord) private attendanceRepo: Repository, - private readonly scope: CampusScope, ) {} async findAll(query?: { name?: string; status?: string; includeArchived?: boolean; tenantId?: number | string }) { @@ -26,11 +24,9 @@ export class StudentsService { if (query?.status) { where.status = query.status; } else if (!query?.includeArchived) { - // Default: hide archived and staff, unless explicitly queried - where.status = Not(In(['archived', 'staff'])); + where.status = Not(In(['archived'])); } - const filteredWhere = await this.scope.filter(where); - return this.repo.find({ where: filteredWhere, order: { createdAt: 'DESC' }, relations: ['tenant'] }); + return this.repo.find({ where, order: { createdAt: 'DESC' }, relations: ['tenant'] }); } async findOne(id: number) {