added guard jwt

This commit is contained in:
2026-02-23 18:16:17 -06:00
parent 472bfebb7a
commit 18b869d681
19 changed files with 112 additions and 53 deletions
+7 -1
View File
@@ -1,31 +1,37 @@
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
import { ProgramaService } from './programa.service';
import { UpdateProgramaDto } from './dto/update-programa.dto';
import { JwtAuthGuard } from 'src/user/jwt.guard';
@Controller('programa')
export class ProgramaController {
constructor(private readonly programaService: ProgramaService) { }
@UseGuards(JwtAuthGuard)
@Get()
findAll() {
return this.programaService.findAll();
}
@UseGuards(JwtAuthGuard)
@Get(':id')
findOne(@Param('id') id: string) {
return this.programaService.findOne(+id);
}
@UseGuards(JwtAuthGuard)
@Post()
create(@Body() body) {
return this.programaService.create(body);
}
@UseGuards(JwtAuthGuard)
@Patch(':id')
update(@Param('id') id: string, @Body() updateProgramaDto: UpdateProgramaDto) {
return this.programaService.update(+id, updateProgramaDto);
}
@UseGuards(JwtAuthGuard)
@Delete(':id')
delete(@Param('id') id:string){
return this.programaService.delete(+id);