added guard jwt
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user