dgp corregido
This commit is contained in:
@@ -116,19 +116,24 @@ export class UsuarioService {
|
||||
id_institucion,
|
||||
1,
|
||||
);
|
||||
const query = this.repository
|
||||
.createQueryBuilder('u')
|
||||
.innerJoinAndSelect('u.instituciones', 'is')
|
||||
.innerJoinAndSelect('u.tipoUsuario', 'tu')
|
||||
.innerJoinAndSelect('is.institucionCarrera', 'ic')
|
||||
.innerJoinAndSelect('ic.carrera', 'c')
|
||||
.innerJoinAndSelect('ic.institucion', 'i')
|
||||
.innerJoinAndSelect('c.nivel', 'n')
|
||||
.where('usuario = :usuario && rfc = :rfc', { usuario, rfc });
|
||||
|
||||
return this.findByUsuario(usuario, true).then(async (existeUsuario) => {
|
||||
/* Falta conexión a soap */
|
||||
if (existeUsuario.password)
|
||||
return query.getOne().then((usuario) => {
|
||||
if (!usuario) throw new NotFoundException('No existe este usuario.');
|
||||
if (usuario.password)
|
||||
throw new ConflictException(
|
||||
'Ya fue regisrado este número de trabajador.',
|
||||
);
|
||||
// if (!existeUsuario.activo)
|
||||
// throw new ConflictException(
|
||||
// 'No se puede registar con este número de trabajador por que se encuentra desactivado.',
|
||||
// );
|
||||
return this.institucionUsuarioService.findByUsuarioInstitucionCarrera(
|
||||
existeUsuario,
|
||||
usuario,
|
||||
institucionCarrera,
|
||||
'trabajador',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user