institución carrera documentación
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
import { IsNumberString } from 'class-validator';
|
||||
|
||||
export class InstitucionCarreraDto {
|
||||
@IsNumberString()
|
||||
id_institucion: string;
|
||||
}
|
||||
@@ -1,13 +1,23 @@
|
||||
import { Controller, Get, Query } from '@nestjs/common';
|
||||
import { InstitucionCarreraService } from './institucion-carrera.service';
|
||||
import { InstitucionCarreraDto } from './dto/institucion-carrera.dto';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('institucion-carrera')
|
||||
@ApiTags('institucion-carrera')
|
||||
export class InstitucionCarreraController {
|
||||
constructor(private institucionCarreraService: InstitucionCarreraService) {}
|
||||
|
||||
@Get()
|
||||
get(@Query() query: InstitucionCarreraDto) {
|
||||
@ApiOperation({
|
||||
description: 'Endpoint que retorna todas las carreras de una institución.',
|
||||
})
|
||||
@ApiQuery({
|
||||
description: 'Id de la institución.',
|
||||
name: 'id_institucion',
|
||||
type: 'string',
|
||||
})
|
||||
get(@Query() query: IdInstitucionDto) {
|
||||
return this.institucionCarreraService.findAllByIdInstitucion(
|
||||
parseInt(query.id_institucion),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user