correcion creacion de operadores
This commit is contained in:
@@ -54,7 +54,7 @@ export class AuthService {
|
|||||||
const modulo = await this.moduloService.findById(id_modulo);
|
const modulo = await this.moduloService.findById(id_modulo);
|
||||||
|
|
||||||
return this.operadorService
|
return this.operadorService
|
||||||
.findByOperador(id_institucion, operador)
|
.findByOperador(id_institucion, operador, false)
|
||||||
.then((operador) => {
|
.then((operador) => {
|
||||||
if (
|
if (
|
||||||
!operador ||
|
!operador ||
|
||||||
|
|||||||
@@ -36,6 +36,13 @@ export class OperadorService {
|
|||||||
throw new ConflictException(
|
throw new ConflictException(
|
||||||
'Ya existe un operador con ese nombre, intente de nuevo.',
|
'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);
|
password = this.bcryptService.encriptar(password);
|
||||||
return this.repository.save(
|
return this.repository.save(
|
||||||
this.repository.create({
|
this.repository.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user