26 lines
857 B
TypeScript
26 lines
857 B
TypeScript
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
|
import { CostoService } from './costo.service';
|
|
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
|
import { RolesGuard } from 'src/roles.guard';
|
|
import { Role } from 'src/role.enum';
|
|
import { Roles } from 'src/roles.decorator';
|
|
|
|
@Controller('costo')
|
|
export class CostoController {
|
|
constructor(private readonly costoService: CostoService) { }
|
|
|
|
@UseGuards(JwtAuthGuard, RolesGuard)
|
|
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL,Role.PCPUMA)
|
|
@Get()
|
|
findAll() {
|
|
return this.costoService.findAll();
|
|
}
|
|
|
|
@UseGuards(JwtAuthGuard, RolesGuard)
|
|
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
|
|
@Get('/:id_servicio')
|
|
find(@Param('id_servicio') id_servicio: number) {
|
|
return this.costoService.find(id_servicio);
|
|
}
|
|
}
|