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
@@ -1,26 +1,31 @@
import { Controller, Get, Body, Patch, Param } from '@nestjs/common';
import { Controller, Get, Body, Patch, Param, UseGuards } from '@nestjs/common';
import { ProgramaEquipoService } from './programa_equipo.service';
import { UpdateProgramaEquipoDto, UpdateProgramasSalaDto } from './dto/update-programa_equipo.dto';
import { JwtAuthGuard } from 'src/user/jwt.guard';
@Controller('programa-equipo')
export class ProgramaEquipoController {
constructor(private readonly programaEquipoService: ProgramaEquipoService) {}
@UseGuards(JwtAuthGuard)
@Get('programas/:id')
findAllProgramByNumber(@Param('id') id: number) {
return this.programaEquipoService.findAllProgramByNumber(+id);
}
@UseGuards(JwtAuthGuard)
@Get('ubicacion/:id')
findAllProgramByUbicacion(@Param('id') id: string) {
return this.programaEquipoService.findAllProgramByUbication(id);
}
@UseGuards(JwtAuthGuard)
@Get(':id')
findOne(@Param('id') id: string) {
return this.programaEquipoService.findOne(id);
}
@UseGuards(JwtAuthGuard)
@Patch('equipo/:id')
updateMachine(
@Param('id') id: string,
@@ -32,6 +37,7 @@ export class ProgramaEquipoController {
);
}
@UseGuards(JwtAuthGuard)
@Patch('sala')
updateBySala(@Body() dto: UpdateProgramasSalaDto) {
return this.programaEquipoService.updateBySala(dto.sala, dto.programas);