FiltroFix

This commit is contained in:
TioSam77
2024-06-16 18:00:25 -06:00
parent ed5f114e7a
commit 03d1deb50d
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ export class ProfesorController {
return this.profesorService.profile(id_profesor);
}
@Post('profile/filter')
@Post('filter')
async filter(@Body() data: profesorDto) {
return this.profesorService.filter(data);
}
+6 -1
View File
@@ -57,7 +57,12 @@ export class ProfesorService {
if (data.nombre) {
query.andWhere('profesor.nombre = :nombre', { nombre: data.nombre });
}
if (data.carrera) {
query.andWhere('profesor.carrera = :carrera', { carrera: data.carrera });
}
if (data.id_categoria) {
query.andWhere('profesor.id_categoria = :id_categoria', { id_categoria: data.id_categoria });
}
return query.getMany();
}