correcion creacion de operadores
This commit is contained in:
@@ -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 ||
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user