Files
formularios_api/src/seccion/seccion.controller.ts
T
Your Name a1f52daa8a swagger
2025-04-02 11:50:08 -06:00

42 lines
1.2 KiB
TypeScript

import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { SeccionService } from './seccion.service';
import { CreateSeccionDto } from './dto/create-seccion.dto';
import { UpdateSeccionDto } from './dto/update-seccion.dto';
import { SeccionApiDocumentation } from './seccion.documentation';
@Controller('seccion')
@SeccionApiDocumentation.ApiController
export class SeccionController {
constructor(private readonly seccionService: SeccionService) {}
@Post()
@SeccionApiDocumentation.ApiCreate
create(@Body() createSeccionDto: CreateSeccionDto) {
return this.seccionService.create(createSeccionDto);
}
@Get()
@SeccionApiDocumentation.ApiGetAll
findAll() {
return this.seccionService.findAll();
}
@Get(':id')
@SeccionApiDocumentation.ApiGetOne
findOne(@Param('id') id: string) {
return this.seccionService.findOne(+id);
}
@Patch(':id')
@SeccionApiDocumentation.ApiUpdate
update(@Param('id') id: string, @Body() updateSeccionDto: UpdateSeccionDto) {
return this.seccionService.update(+id, updateSeccionDto);
}
@Delete(':id')
@SeccionApiDocumentation.ApiRemove
remove(@Param('id') id: string) {
return this.seccionService.remove(+id);
}
}