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')
@ApiTags('State')
export class StateController {
  constructor(private readonly stateService: StateService) {}
  @ApiCreatedResponse({
    isArray: true,
    type: StateResponseDto,
  })
  @Get()
  async findAll() {
    const states: StateResponseDto[] = await this.stateService.findAll();
    return states;
  }
}
