Commit 5b45ac0a authored by Diego Iván's avatar Diego Iván
Browse files

agregando docs de town

parent b0dde758
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
import { Controller, Get, Post, Param, Delete, UseInterceptors, UploadedFile, Body } from '@nestjs/common';
import { TownService } from './town.service';
import { ApiTags } from '@nestjs/swagger';
import { ApiBody, ApiConsumes, 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';
@@ -9,6 +9,8 @@ import { CreateTownDto } from './dto/create-town.dto';
export class TownController {
  constructor(private readonly townService: TownService) {}

  @ApiBody({ type: CreateTownDto })
  @ApiConsumes('multipart/form-data')
  @Post()
  @UseInterceptors(fileInterceptor('image', 'static/towns/', ['.jpg', '.jpeg', '.png']))
  async create(@UploadedFile(new FileValidationPipe()) file, @Body() createTownDto: CreateTownDto) {