Merge branch 'pmodulos' of https://repositorio.acatlan.unam.mx/CIDWA/pcpuma_unam_api
This commit is contained in:
commit
64e319f230
@ -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;
|
||||
});
|
||||
|
@ -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.',
|
||||
|
Loading…
Reference in New Issue
Block a user