filter
This commit is contained in:
@@ -67,7 +67,7 @@ export class ProfesorService {
|
||||
}
|
||||
|
||||
//brings teachers by filter
|
||||
async filter(filterDto: ProfesorFilterDto): Promise<Profesor[]> {
|
||||
async filter(filterDto: profesorDto): Promise<Profesor[]> {
|
||||
const query = this.profesorRepository.createQueryBuilder('profesor');
|
||||
|
||||
if (filterDto.nombre) {
|
||||
@@ -78,11 +78,6 @@ export class ProfesorService {
|
||||
query.andWhere('profesor.id_categoria = :id_categoria', { id_categoria: filterDto.id_categoria });
|
||||
}
|
||||
|
||||
if (filterDto.id_carrera !== undefined) {
|
||||
query.innerJoin('profesor.asignaturaCarreraProfesores', 'acp')
|
||||
.andWhere('acp.id_carrera = :id_carrera', { id_carrera: filterDto.id_carrera });
|
||||
}
|
||||
|
||||
if (filterDto.extension) {
|
||||
query.andWhere('profesor.extension like :extension', { extension: `%${filterDto.extension}%` });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user