Files
formularios_api/src/seccion/seccion.controller.ts
T

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-03-26 14:39:56 -06:00
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';
2025-04-02 11:50:08 -06:00
import { SeccionApiDocumentation } from './seccion.documentation';
2025-03-26 14:39:56 -06:00
@Controller('seccion')
2025-04-02 11:50:08 -06:00
@SeccionApiDocumentation.ApiController
2025-03-26 14:39:56 -06:00
export class SeccionController {
constructor(private readonly seccionService: SeccionService) {}
@Post()
2025-04-02 11:50:08 -06:00
@SeccionApiDocumentation.ApiCreate
2025-03-26 14:39:56 -06:00
create(@Body() createSeccionDto: CreateSeccionDto) {
return this.seccionService.create(createSeccionDto);
}
@Get()
2025-04-02 11:50:08 -06:00
@SeccionApiDocumentation.ApiGetAll
2025-03-26 14:39:56 -06:00
findAll() {
return this.seccionService.findAll();
}
@Get(':id')
2025-04-02 11:50:08 -06:00
@SeccionApiDocumentation.ApiGetOne
2025-03-26 14:39:56 -06:00
findOne(@Param('id') id: string) {
return this.seccionService.findOne(+id);
}
@Patch(':id')
2025-04-02 11:50:08 -06:00
@SeccionApiDocumentation.ApiUpdate
2025-03-26 14:39:56 -06:00
update(@Param('id') id: string, @Body() updateSeccionDto: UpdateSeccionDto) {
return this.seccionService.update(+id, updateSeccionDto);
}
@Delete(':id')
2025-04-02 11:50:08 -06:00
@SeccionApiDocumentation.ApiRemove
2025-03-26 14:39:56 -06:00
remove(@Param('id') id: string) {
return this.seccionService.remove(+id);
}
}