Modificaciones, se agregaron las relaciones de tipoUsuario
This commit is contained in:
@@ -56,7 +56,7 @@ export class ServicioController {
|
||||
}
|
||||
|
||||
@Get('servicios_responsable')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
//@UseGuards(AuthGuard('jwt'))
|
||||
async obtenerServiciosResponsable(@Query() dto: ServiciosResponsableDto) {
|
||||
return await this.servicioService.obtenerServiciosResponsable(dto);
|
||||
}
|
||||
|
||||
@@ -1300,6 +1300,7 @@ export class ServicioService {
|
||||
// 1️⃣ Validar que el usuario exista y sea responsable
|
||||
const responsable = await this.usuarioRepo.findOne({
|
||||
where: { idUsuario },
|
||||
relations: ['tipoUsuario'],
|
||||
});
|
||||
if (!responsable) throw new NotFoundException('No existe este usuario.');
|
||||
if (responsable.tipoUsuario.idTipoUsuario !== 2)
|
||||
|
||||
Reference in New Issue
Block a user