endpoint profesores
This commit is contained in:
parent
ef2c230c62
commit
9b5eb7ecda
@ -25,4 +25,20 @@ export class InstitucionCarreraController {
|
|||||||
parseInt(query.id_institucion),
|
parseInt(query.id_institucion),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Serealize(InstitucionCarreaOutputDto)
|
||||||
|
@Get('institucion-profesor')
|
||||||
|
@ApiOperation({
|
||||||
|
description: 'Endpoint que retorna todas las carreras de una institución.',
|
||||||
|
})
|
||||||
|
@ApiQuery({
|
||||||
|
description: 'Id de la institución.',
|
||||||
|
name: 'id_institucion',
|
||||||
|
type: 'string',
|
||||||
|
})
|
||||||
|
institucionProfesor(@Query() query: IdInstitucionDto) {
|
||||||
|
return this.institucionCarreraService.findInstitucionProfesor(
|
||||||
|
parseInt(query.id_institucion),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,4 +69,15 @@ export class InstitucionCarreraService {
|
|||||||
return carrera;
|
return carrera;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findInstitucionProfesor(id_institucion: number) {
|
||||||
|
return this.institucionService
|
||||||
|
.findById(id_institucion)
|
||||||
|
.then((institucion) =>
|
||||||
|
this.institucionCarreraRepository.findOne({
|
||||||
|
carrera: { id_carrera: 1 },
|
||||||
|
institucion,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,9 +252,7 @@ export class MultaService {
|
|||||||
'u.instituciones',
|
'u.instituciones',
|
||||||
'is',
|
'is',
|
||||||
'is.id_institucion_usuario = :id_institucion_usuario',
|
'is.id_institucion_usuario = :id_institucion_usuario',
|
||||||
{
|
{ id_institucion_usuario: institucionUsuario.id_institucion_usuario },
|
||||||
id_institucion_usuario: institucionUsuario.id_institucion_usuario,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
.where('activo = 1')
|
.where('activo = 1')
|
||||||
.getOne()
|
.getOne()
|
||||||
|
Loading…
Reference in New Issue
Block a user