endpoint responsables
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Expose } from 'class-transformer';
|
||||
|
||||
export class InstitucionesMinOutputDto {
|
||||
@Expose()
|
||||
id_institucion;
|
||||
|
||||
@Expose()
|
||||
institucion;
|
||||
|
||||
@Expose()
|
||||
email_institucional;
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Expose } from 'class-transformer';
|
||||
|
||||
export class InstitucionesOutputDto {
|
||||
@Expose()
|
||||
correo;
|
||||
|
||||
@Expose()
|
||||
id_institucion;
|
||||
|
||||
@@ -8,5 +11,8 @@ export class InstitucionesOutputDto {
|
||||
institucion;
|
||||
|
||||
@Expose()
|
||||
email_institucional;
|
||||
nombre;
|
||||
|
||||
@Expose()
|
||||
responsable;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { UpdateInstitucionDto } from './dto/input/update.dto';
|
||||
import { InstitucionOutputDto } from './dto/output/institucion.dto';
|
||||
import { InstitucionesOutputDto } from './dto/output/instituciones.dto';
|
||||
import { InstitucionesMinOutputDto } from './dto/output/instituciones-min.dto';
|
||||
import { InstitucionMinOutputDto } from './dto/output/institucion-min.dto';
|
||||
|
||||
@Controller('institucion')
|
||||
@@ -31,6 +32,17 @@ export class InstitucionController {
|
||||
return this.institucionService.findAll();
|
||||
}
|
||||
|
||||
@Serealize(InstitucionesOutputDto)
|
||||
@Get('instituciones')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiOperation({
|
||||
description: 'Endpoint que retorna todas las instituciones.',
|
||||
})
|
||||
@ApiBearerAuth('jwt')
|
||||
instituciones() {
|
||||
return this.institucionService.findAll();
|
||||
}
|
||||
|
||||
@Serealize(InstitucionOutputDto)
|
||||
@Get('institucion')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@@ -47,7 +59,7 @@ export class InstitucionController {
|
||||
return this.institucionService.findById(parseInt(query.id_institucion));
|
||||
}
|
||||
|
||||
@Serealize(InstitucionesOutputDto)
|
||||
@Serealize(InstitucionesMinOutputDto)
|
||||
@Get('activas')
|
||||
@ApiOperation({
|
||||
description: 'Endpoint que retorna todas las instituciones activas.',
|
||||
|
||||
Reference in New Issue
Block a user