Modificaciones, se agregaron las relaciones de tipoUsuario

This commit is contained in:
Patriots01
2025-11-26 21:14:13 +00:00
parent 340c0d59fd
commit 083cefe84a
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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);
}
+1
View File
@@ -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)