This commit is contained in:
lemuel 2022-08-12 17:16:57 -05:00
commit 64e319f230
2 changed files with 25 additions and 11 deletions

View File

@ -45,7 +45,7 @@ export class InstitucionUsuarioService {
.then((institucionUsuario) => {
if (!institucionUsuario)
throw new ConflictException(
`No se encontró información de este número de ${campo} en esta institución.`,
'Los datos que se ingrasaron no son correctos.',
);
return institucionUsuario;
});

View File

@ -94,15 +94,26 @@ export class UsuarioService {
id_institucion_carrera,
);
return this.findByUsuario(usuario, true).then(async (existeUsuario) => {
if (existeUsuario.password)
throw new ConflictException('Ya fue regisrado este número de cuenta.');
return this.institucionUsuarioService.findByUsuarioInstitucionCarrera(
existeUsuario,
institucionCarrera,
'cuenta',
);
});
return this.findByUsuario(usuario, false)
.then(async (existeUsuario) => {
if (!usuario)
throw new ConflictException(
'Los datos que se ingrasaron no son correctos.',
);
if (existeUsuario.password)
throw new ConflictException(
'Ya fue regisrado este número de cuenta.',
);
return this.institucionUsuarioService.findByUsuarioInstitucionCarrera(
existeUsuario,
institucionCarrera,
'cuenta',
);
})
.then((institucionUsuario) => {
if (!institucionUsuario) {
}
});
}
async DGP(id_institucion: number, usuario: string, rfc: string) {
@ -122,7 +133,10 @@ export class UsuarioService {
.where('usuario = :usuario && rfc = :rfc', { usuario, rfc })
.getOne()
.then((usuario) => {
if (!usuario) throw new NotFoundException('No existe este usuario.');
if (!usuario)
throw new NotFoundException(
'Los datos que se ingrasaron no son correctos.',
);
if (usuario.password)
throw new ConflictException(
'Ya fue regisrado este número de trabajador.',