Commit 1447dfb1 authored by Diego Iván's avatar Diego Iván
Browse files

agregando autorizacion para crear un pueblo

parent b120febf
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
import { Controller, Get, Post, Param, Delete, UseInterceptors, UploadedFile, Body, Query } from '@nestjs/common';
import { TownService } from './town.service';
import { ApiBody, ApiConsumes, ApiParam, ApiQuery, ApiTags } from '@nestjs/swagger';
import { ApiBearerAuth, 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';
import { Roles } from 'src/auth/role.decorator';
import { SUPERADMIN_ROLES } from 'src/shared/enum/admin-role.enum';
@Controller()
@ApiTags('Pueblos')
export class TownController {
  constructor(
    private readonly townService: TownService,
    // private readonly stateService: StateService,
  ) {}
  constructor(private readonly townService: TownService) {}

  @Roles(SUPERADMIN_ROLES)
  @ApiBearerAuth('jwt')
  @ApiBody({ type: CreateTownDto })
  @ApiConsumes('multipart/form-data')
  @Post('town')