import { Controller, Get, Post, Patch, Delete, Body, Param, Query } from '@nestjs/common';
import { SubcategoriasService } from './subcategorias.service';

@Controller('subcategorias')
export class SubcategoriasController {
  constructor(private svc: SubcategoriasService) {}

  @Get() findAll(@Query('categoria_id') categoriaId?: string) { return this.svc.findAll(categoriaId); }
  @Get(':id') findOne(@Param('id') id: string) { return this.svc.findOne(id); }
  @Post() create(@Body() body: any) { return this.svc.create(body); }
  @Patch(':id') update(@Param('id') id: string, @Body() body: any) { return this.svc.update(id, body); }
  @Delete(':id') remove(@Param('id') id: string) { return this.svc.remove(id); }
}
