Files
api-AT/src/programa/programa.controller.ts
T

41 lines
1.0 KiB
TypeScript
Raw Normal View History

2026-02-23 18:16:17 -06:00
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
import { ProgramaService } from './programa.service';
import { UpdateProgramaDto } from './dto/update-programa.dto';
2026-02-23 18:16:17 -06:00
import { JwtAuthGuard } from 'src/user/jwt.guard';
@Controller('programa')
export class ProgramaController {
2026-02-19 08:33:53 -06:00
constructor(private readonly programaService: ProgramaService) { }
2026-02-23 18:16:17 -06:00
@UseGuards(JwtAuthGuard)
@Get()
findAll() {
return this.programaService.findAll();
}
2026-02-23 18:16:17 -06:00
@UseGuards(JwtAuthGuard)
@Get(':id')
findOne(@Param('id') id: string) {
return this.programaService.findOne(+id);
}
2026-02-19 08:33:53 -06:00
2026-02-23 18:16:17 -06:00
@UseGuards(JwtAuthGuard)
2026-02-19 08:33:53 -06:00
@Post()
2026-02-03 12:47:07 -05:00
create(@Body() body) {
return this.programaService.create(body);
}
2026-02-23 18:16:17 -06:00
@UseGuards(JwtAuthGuard)
@Patch(':id')
update(@Param('id') id: string, @Body() updateProgramaDto: UpdateProgramaDto) {
return this.programaService.update(+id, updateProgramaDto);
}
2026-02-23 18:16:17 -06:00
@UseGuards(JwtAuthGuard)
2026-02-19 08:33:53 -06:00
@Delete(':id')
delete(@Param('id') id:string){
return this.programaService.delete(+id);
}
}