Fix: corregir cuenta de parámetros en INSERT cultivos

This commit is contained in:
2026-04-16 01:51:28 -03:00
parent 4257d33abd
commit 03c5875ce6
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -269,9 +269,9 @@ app.put('/api/state', (req, res) => {
}
if (state.cultivos?.length) {
const stmt = db.prepare('INSERT INTO cultivos (id, pacienteId, internacionId, fechaToma, protocolo, tipoMuestra, observaciones, estado, fechaResultado, germen, sensible, resistente) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
const stmt = db.prepare('INSERT INTO cultivos (id, pacienteId, internacionId, fechaToma, protocolo, tipoMuestra, observaciones, estado, fechaResultado, germen, sensible, resistente) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
for (const c of state.cultivos) {
stmt.run(c.id, c.pacienteId, c.internacionId, c.fechaToma, c.protocolo, c.tipoMuestra, c.observaciones, c.estado, c.fechaResultado, c.germen, c.sensible, c.resistente);
stmt.run(c.id, c.pacienteId, c.internacionId || null, c.fechaToma || null, c.protocolo || null, c.tipoMuestra || null, c.observaciones || null, c.estado || null, c.fechaResultado || null, c.germen || null, c.sensible || null, c.resistente || null);
}
}