Files
api-AT/src/sancion/sancion.controller.ts
T

25 lines
778 B
TypeScript
Raw Normal View History

2026-02-23 18:16:17 -06:00
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
2025-09-17 16:35:52 -06:00
import { SancionService } from './sancion.service';
2026-02-23 18:16:17 -06:00
import { JwtAuthGuard } from 'src/user/jwt.guard';
2026-03-02 14:49:15 -06:00
import { RolesGuard } from 'src/roles.guard';
import { Roles } from 'src/roles.decorator';
import { Role } from 'src/role.enum';
2025-09-17 16:35:52 -06:00
@Controller('sancion')
export class SancionController {
2026-03-02 14:49:15 -06:00
constructor(private readonly sancionService: SancionService) { }
2025-09-17 16:35:52 -06:00
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
2025-10-02 17:03:25 -06:00
@Get()
find() {
return this.sancionService.find();
}
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
2025-09-17 16:35:52 -06:00
@Get(':id')
2025-09-24 11:00:56 -06:00
findOne(@Param('id') id: number) {
2025-09-17 16:35:52 -06:00
return this.sancionService.findOne(+id);
}
}