From 06f3a32a3553b4e5e7aa67ef51ac638ac9928945 Mon Sep 17 00:00:00 2001 From: arturo Date: Mon, 9 Mar 2020 21:04:59 -0600 Subject: [PATCH] probar sin compilar --- routes/post_factura.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routes/post_factura.js b/routes/post_factura.js index 04b7162..4e1b9b6 100644 --- a/routes/post_factura.js +++ b/routes/post_factura.js @@ -33,6 +33,8 @@ app.post('/post_factura', async(req, res) => { let correo = depurado(req.body.correo); if (rfc.lenght > 245 || domicilio.lenght > 245 || telefono.lenght > 245 || correo.lenght > 255) res.status(400).json({ error: true, msj: "Datos muy grandes" }); + let p=`delete from factura where id_persona=${id_persona};`; + let pp= await query(p); let cad = `insert into factura values(null, ${id_persona}, '${rfc}', '${domicilio}', '${telefono}', '${correo}');`; let uni = await query(cad); let n_cad=`select * from factura where id_persona=${id_persona};`;