modulo input y output dto
This commit is contained in:
@@ -9,11 +9,12 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { ApiBody, ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger';
|
||||
import { Serealize } from '../interceptors/serialize.interceptor';
|
||||
import { ModuloService } from './modulo.service';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { ModuloCreateDto } from './dto/modulo-create.dto';
|
||||
import { ModuloUpdateDto } from './dto/modulo-update.dto';
|
||||
// import { Serealize } from '../interceptors/serialize.interceptor';
|
||||
import { CreateModuloDto } from './dto/input/create.dto';
|
||||
import { UpdateModuloDto } from './dto/input/update.dto';
|
||||
import { ModulosOutputDto } from './dto/output/modulos.dto';
|
||||
|
||||
@Controller('modulo')
|
||||
@ApiTags('modulo')
|
||||
@@ -27,10 +28,11 @@ export class ModuloController {
|
||||
description: 'Ambas variables son obligatorias.',
|
||||
examples: { ejemplo: { value: { id_institucion: 200, modulo: '' } } },
|
||||
})
|
||||
create(@Body() body: ModuloCreateDto) {
|
||||
create(@Body() body: CreateModuloDto) {
|
||||
return this.moduloService.create(body.id_institucion, body.modulo);
|
||||
}
|
||||
|
||||
@Serealize(ModulosOutputDto)
|
||||
@Get()
|
||||
@ApiOperation({
|
||||
description: 'Endpoint que retorna todos los módulos de una institución.',
|
||||
@@ -57,7 +59,7 @@ export class ModuloController {
|
||||
ejemplo: { value: { id_modulo: 1, activo: true, modulo: '' } },
|
||||
},
|
||||
})
|
||||
update(@Body() body: ModuloUpdateDto) {
|
||||
update(@Body() body: UpdateModuloDto) {
|
||||
return this.moduloService.update(body);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user