import { Body, Controller, Get, Post } from '@nestjs/common';
import { CreateStructureDto } from './dto/create-structure.dto';
import { Structure } from './schemas/structure.schema';
import { StructuresService } from './structures.service';

@Controller('structures')
export class StructuresController {
  constructor(private readonly structureService: StructuresService) {}

  @Post()
  async create(@Body() createCatDto: CreateStructureDto) {
    await this.structureService.create(createCatDto);
  }

  @Get()
  async findAll(): Promise<Structure[]> {
    return this.structureService.findAll();
  }
}