carrera-programa input output dto

This commit is contained in:
xXpuma99Xx
2022-06-13 23:28:47 -05:00
parent cfecb31d5d
commit a1be0e5907
13 changed files with 51 additions and 19 deletions
@@ -1,9 +1,11 @@
import { Body, Controller, Delete, Get, Post, Query } from '@nestjs/common';
import { ApiBody, ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger';
import { Serealize } from '../interceptors/serialize.interceptor';
import { CarreraProgramaService } from './carrera-programa.service';
import { IdInstitucionDto } from '../dto/id-institucion.dto';
import { CarreraProgramaCreateDto } from './dto/carrera-programa-create.dto';
import { CarreraProgramaDeleteDto } from './dto/carrera-programa-delete.dto';
import { CreateCarreraProgramaDto } from './dto/input/create.dto';
import { DeleteCarreraProgramaDto } from './dto/input/delete.dto';
import { CarreraProgramaOutputDto } from './dto/output/carrera-programa.dto';
@Controller('carrera-programa')
@ApiTags('carrera-programa')
@@ -21,7 +23,7 @@ export class CarreraProgramaController {
ejemplo: { value: { id_institucion_carrera: 36, id_programa: 1 } },
},
})
create(@Body() body: CarreraProgramaCreateDto) {
create(@Body() body: CreateCarreraProgramaDto) {
return this.carreraProgramaService.create(
body.id_institucion_carrera,
body.id_programa,
@@ -37,10 +39,11 @@ export class CarreraProgramaController {
description: 'Es obligatorio mandar la variable id_carrera_programa.',
examples: { ejemplo: { value: { id_carrera_programa: 1 } } },
})
delete(@Body() body: CarreraProgramaDeleteDto) {
delete(@Body() body: DeleteCarreraProgramaDto) {
return this.carreraProgramaService.delete(body.id_carrera_programa);
}
@Serealize(CarreraProgramaOutputDto)
@Get()
@ApiOperation({
description: