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

34 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-02-23 18:16:17 -06:00
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
import { AreaUbicacionService } from './area_ubicacion.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';
@Controller('area-ubicacion')
export class AreaUbicacionController {
2026-02-23 18:16:17 -06:00
constructor(private readonly areaUbicacionService: AreaUbicacionService) { }
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL)
@Get()
findAll() {
return this.areaUbicacionService.findAll();
}
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
@Get(':id')
findOne(@Param('id') id: string) {
return this.areaUbicacionService.findOne(+id);
}
2026-01-28 14:51:12 -06:00
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
2026-01-28 14:51:12 -06:00
@Get('/programs/:id')
2026-02-23 18:16:17 -06:00
findProgramsByArea(@Param('id') id: number) {
2026-01-28 14:51:12 -06:00
return this.areaUbicacionService.findProgramsByArea(+id)
}
}
//IO