From 4b491b318ddb415c0f8670563c85e7f0328406cd Mon Sep 17 00:00:00 2001 From: MarianoCampetella Date: Fri, 22 May 2026 15:23:31 -0300 Subject: [PATCH] fit de notas en matriculaciones --- core/tm/routes/profesional.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/tm/routes/profesional.ts b/core/tm/routes/profesional.ts index 8bd485b45..5a3d059d6 100644 --- a/core/tm/routes/profesional.ts +++ b/core/tm/routes/profesional.ts @@ -1335,19 +1335,15 @@ router.patch('/profesionales/:id?', Auth.authenticate(), async (req, res, next) } else if (req.body.accion === 'eliminar') { resultado.notas.splice(req.body.indice, 1); } else { // si no es editar ni eliminar, es agregar. - // Verificamos si dentro del array hay un string vacio. - const ultimoElemento = resultado.notas[resultado.notas.length - 1]; - if (typeof ultimoElemento === 'string') { - if (ultimoElemento.length === 0) { - resultado.notas = []; - } + if (!resultado.notas) { + resultado.notas = []; } const nota = { descripcion: req.body.data, usuario: req.body.agente, fecha: new Date() }; - resultado.notas.unshift(nota); + resultado.notas.push(nota); } break; case 'updateSancion':