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
+6 -1
View File
@@ -1,21 +1,25 @@
import { Controller, Body, Patch, Param, Get } from '@nestjs/common';
import { Controller, Body, Patch, Param, Get, UseGuards } from '@nestjs/common';
import { MesaService } from './mesa.service';
import { UpdateMesaDto } from './dto/update-mesa.dto';
import { JwtAuthGuard } from 'src/user/jwt.guard';
@Controller('mesa')
export class MesaController {
constructor(private readonly mesaService: MesaService) { }
@UseGuards(JwtAuthGuard)
@Get()
async findAll() {
return this.mesaService.findAll();
}
@UseGuards(JwtAuthGuard)
@Get('activo')
async findAllActivo() {
return this.mesaService.findAllActivo();
}
@UseGuards(JwtAuthGuard)
@Patch(':id')
async updateActivo(
@Param('id') id: number,
@@ -24,6 +28,7 @@ export class MesaController {
return this.mesaService.updateActivo(id, updateMesaDto);
}
@UseGuards(JwtAuthGuard)
@Patch(':id/activo')
toggleActivo(@Param('id') id: number) {
return this.mesaService.toggleActivo(+id);