FiltroFix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user