import { Controller, Get, Param, UseGuards } from '@nestjs/common'; import { AreaUbicacionService } from './area_ubicacion.service'; 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('area-ubicacion') export class AreaUbicacionController { constructor(private readonly areaUbicacionService: AreaUbicacionService) { } @UseGuards(JwtAuthGuard, RolesGuard) @Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL) @Get() findAll() { return this.areaUbicacionService.findAll(); } @UseGuards(JwtAuthGuard, RolesGuard) @Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR) @Get(':id') findOne(@Param('id') id: string) { return this.areaUbicacionService.findOne(+id); } @UseGuards(JwtAuthGuard, RolesGuard) @Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR) @Get('/programs/:id') findProgramsByArea(@Param('id') id: number) { return this.areaUbicacionService.findProgramsByArea(+id) } } //IO