added guard jwt
This commit is contained in:
@@ -5,45 +5,53 @@ import {
|
||||
Body,
|
||||
Patch,
|
||||
Param,
|
||||
Delete,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { BitacoraMesaService } from './bitacora_mesa.service';
|
||||
import { CreateBitacoraMesaDto, FindByDate } from './dto/create-bitacora_mesa.dto';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
|
||||
@Controller('bitacora-mesa')
|
||||
export class BitacoraMesaController {
|
||||
constructor(private readonly bitacoraMesaService: BitacoraMesaService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
assignment(@Body() createBitacoraMesaDto: CreateBitacoraMesaDto) {
|
||||
return this.bitacoraMesaService.assignment(createBitacoraMesaDto);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.bitacoraMesaService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.bitacoraMesaService.findOne(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/cuenta/:id_cuenta')
|
||||
findByCuenta(@Param('id_cuenta') id_cuenta: string) {
|
||||
return this.bitacoraMesaService.findByCuenta(+id_cuenta);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/table/:id_mesa')
|
||||
findByTable(@Param('id_mesa') id_mesa: number) {
|
||||
return this.bitacoraMesaService.findByTable(id_mesa);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('/date')
|
||||
findByDate(@Body() data: FindByDate) {
|
||||
return this.bitacoraMesaService.findByDate(data.date);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('cancelar/:id')
|
||||
cancelationByMachine(
|
||||
@Param('id') id: number,
|
||||
@@ -52,6 +60,7 @@ export class BitacoraMesaController {
|
||||
return this.bitacoraMesaService.cancelation(id, tiempo_asignado);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('mesas-por-dia')
|
||||
mesasPorDia(@Body() body: { fecha: string }) {
|
||||
return this.bitacoraMesaService.mesasPorFecha(body.fecha);
|
||||
|
||||
Reference in New Issue
Block a user