Skip to content

Commit

Permalink
fix(MPI): corrige error relaciones null
Browse files Browse the repository at this point in the history
  • Loading branch information
MCele committed Nov 28, 2023
1 parent 34245da commit 32974c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core-v2/mpi/paciente/paciente.events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ EventCore.on('mpi:pacientes:update', async (paciente: any, changeFields: string[
}
}
}
if (changeFields.includes('activo')) {
if (changeFields.includes('activo') && paciente.relaciones) {
// Obtenemos todos los pacientes relacionados del paciente desactivado/activado en un array de promesas.
let relacionados = paciente.relaciones.map(r => Paciente.findById(r.referencia));
relacionados = await Promise.all(relacionados);
Expand Down

0 comments on commit 32974c4

Please sign in to comment.