Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions modules/rup/controllers/prestacion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ export function updateRegistroHistorialSolicitud(solicitud, datos) {
if (datos.turnos) {
registroHistorial.turno = datos.turnos[0];
}
if (solicitud.profesional && solicitud.profesional.id) {
registroHistorial.profesional = solicitud.profesional;
let profesional = solicitud.profesional;
if (datos.op === 'estadoPush' && datos.estado?.tipo === 'asignada' && datos.profesional) {
profesional = datos.profesional;
}

if (profesional && profesional.id) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estaria bueno simplificar este if, por el encadenamiento opcional... quedaría como if (profesional?.id)...

registroHistorial.profesional = profesional;
}

solicitud.historial.push(registroHistorial);
Expand Down
Loading