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

20 lines
700 B
TypeScript
Raw Normal View History

2026-02-23 18:16:17 -06:00
import { Controller, Get, UseGuards } from '@nestjs/common';
2025-09-26 17:43:19 -06:00
import { CarreraService } from './carrera.service';
2025-10-08 15:45:21 -06:00
import { Carrera } from './entities/carrera.entity';
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-26 17:43:19 -06:00
@Controller('carrera')
export class CarreraController {
2026-02-23 18:16:17 -06:00
constructor(private readonly carreraService: CarreraService) { }
2025-09-26 17:43:19 -06:00
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL)
2025-09-26 17:43:19 -06:00
@Get()
2025-10-08 15:45:21 -06:00
findAll(): Promise<Carrera[]> {
2025-09-26 17:43:19 -06:00
return this.carreraService.findAll();
}
}