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

agregando docs para endpoin de state

parent 6a3da0d1
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
import { Controller, Get } from '@nestjs/common';
import { StateService } from './state.service';
import { ApiCreatedResponse, ApiTags } from '@nestjs/swagger';
import { StateResponseDto } from './dto/state-res.dto';

@Controller('state')
@Controller('town')
@ApiTags('State')
export class StateController {
  constructor(private readonly stateService: StateService) {}

  @ApiCreatedResponse({
    isArray: true,
    type: StateResponseDto,
  })
  @Get()
  findAll() {
    return this.stateService.findAll();
  async findAll() {
    const states: StateResponseDto[] = await this.stateService.findAll();
    return states;
  }
}