hot fix al mero toque
This commit is contained in:
@@ -46,7 +46,9 @@ export class Operador {
|
||||
@JoinColumn({ name: 'id_institucion' })
|
||||
institucion: Institucion;
|
||||
|
||||
@ManyToOne(() => TipoUsuario, (tipoUsuario) => tipoUsuario.operadores)
|
||||
@ManyToOne(() => TipoUsuario, (tipoUsuario) => tipoUsuario.operadores, {
|
||||
eager: true,
|
||||
})
|
||||
@JoinColumn({ name: 'id_tipo_usuario' })
|
||||
tipoUsuario: TipoUsuario;
|
||||
|
||||
|
||||
@@ -93,9 +93,9 @@ export class OperadorService {
|
||||
}
|
||||
|
||||
findAdmin(admin: string): Promise<Operador> {
|
||||
return this.fullInformacionOperadorView
|
||||
.findOne({ where: { operador: admin, id_tipo_usuario: Between(2, 3) } })
|
||||
.then((infoOperador) => this.fullViewToOperador(infoOperador));
|
||||
return this.repository.findOne({
|
||||
where: { operador: admin, id_tipo_usuario: Between(2, 3) },
|
||||
});
|
||||
}
|
||||
|
||||
async findAll(
|
||||
@@ -164,9 +164,9 @@ export class OperadorService {
|
||||
.then((operador) => {
|
||||
if (!operador)
|
||||
throw new NotFoundException('No existe este id operador.');
|
||||
operador.tipoUsuario = this.tipoUsuarioService.crearTipoUsuario(
|
||||
operador.id_tipo_usuario,
|
||||
);
|
||||
// operador.tipoUsuario = this.tipoUsuarioService.crearTipoUsuario(
|
||||
// operador.id_tipo_usuario,
|
||||
// );
|
||||
return operador;
|
||||
});
|
||||
}
|
||||
@@ -184,6 +184,7 @@ export class OperadorService {
|
||||
}
|
||||
|
||||
fullViewToOperador(infoOperador: FullInformacionOperadorView): Operador {
|
||||
if (!infoOperador) return null;
|
||||
return this.repository.create({
|
||||
id_operador: infoOperador.id_operador,
|
||||
activo: infoOperador.activo === 1,
|
||||
|
||||
Reference in New Issue
Block a user