20 lines
700 B
TypeScript
20 lines
700 B
TypeScript
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import { CarreraService } from './carrera.service';
|
|
import { Carrera } from './entities/carrera.entity';
|
|
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
|
import { RolesGuard } from 'src/roles.guard';
|
|
import { Roles } from 'src/roles.decorator';
|
|
import { Role } from 'src/role.enum';
|
|
|
|
@Controller('carrera')
|
|
export class CarreraController {
|
|
constructor(private readonly carreraService: CarreraService) { }
|
|
|
|
@UseGuards(JwtAuthGuard, RolesGuard)
|
|
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL)
|
|
@Get()
|
|
findAll(): Promise<Carrera[]> {
|
|
return this.carreraService.findAll();
|
|
}
|
|
}
|