Loading backend/src/state/state.controller.ts +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; } } Loading
backend/src/state/state.controller.ts +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; } }