From c68121c5796bf58e61f132d479e9d7046a72fead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Iv=C3=A1n?= <80365304+Diego-lvan@users.noreply.github.com> Date: Thu, 2 May 2024 11:13:43 -0600 Subject: [PATCH] agregando docs para endpoint get towns --- backend/src/town/town.controller.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/town/town.controller.ts b/backend/src/town/town.controller.ts index dacf583d..a21509d3 100644 --- a/backend/src/town/town.controller.ts +++ b/backend/src/town/town.controller.ts @@ -1,11 +1,11 @@ import { Controller, Get, Post, Param, Delete, UseInterceptors, UploadedFile, Body, Query } from '@nestjs/common'; import { TownService } from './town.service'; -import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger'; +import { ApiBody, ApiConsumes, ApiParam, ApiQuery, ApiTags } from '@nestjs/swagger'; import { FileValidationPipe } from 'src/shared/pipe/file-validation.pipe'; import { fileInterceptor } from 'src/shared/interceptors/file-save.interceptor'; import { CreateTownDto } from './dto/create-town.dto'; @Controller() -@ApiTags('Agregar un pueblo') +@ApiTags('Pueblos') export class TownController { constructor( private readonly townService: TownService, @@ -25,7 +25,8 @@ export class TownController { throw error; } } - + @ApiParam({ name: 'stateId', type: Number }) + @ApiQuery({ name: 'lang', type: String }) @Get('state/:stateId/town') async findTownsByState(@Param('stateId') stateId: number, @Query('lang') lang) { try { -- GitLab