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};`;