correcion creacion de operadores

This commit is contained in:
xXpuma99Xx
2022-05-02 16:43:55 -05:00
parent c5bd685683
commit a4bc89d2ff
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ export class AuthService {
const modulo = await this.moduloService.findById(id_modulo);
return this.operadorService
.findByOperador(id_institucion, operador)
.findByOperador(id_institucion, operador, false)
.then((operador) => {
if (
!operador ||
+7
View File
@@ -36,6 +36,13 @@ export class OperadorService {
throw new ConflictException(
'Ya existe un operador con ese nombre, intente de nuevo.',
);
return this.findAdmin(operador, false);
})
.then((existeAdmin) => {
if (existeAdmin)
throw new ConflictException(
'Ya existe un admin con ese nombre, intente de nuevo.',
);
password = this.bcryptService.encriptar(password);
return this.repository.save(
this.repository.create({