varificacion del tiṕo de dato de las entradas
This commit is contained in:
+21
-8
@@ -30,17 +30,30 @@ function query(consulta) {
|
||||
app.post('/actualizar', async(req, res) => {
|
||||
|
||||
//console.log(req.body);
|
||||
console.log("lalalalal");
|
||||
let po = " "
|
||||
console.log(typeof(req.body.datos_proyecto.nombre_proyecto));
|
||||
if (typeof(req.body.datos_proyecto.nombre_proyecto) == typeof(po)) {
|
||||
console.log("simon ...");
|
||||
req.body.datos_proyecto.nombre_proyecto = req.body.datos_proyecto.nombre_proyecto.replace(/'/g, "''");
|
||||
}
|
||||
if (typeof(req.body.datos_proyecto.nombre_responsable) == typeof(po))
|
||||
req.body.datos_proyecto.nombre_responsable = req.body.datos_proyecto.nombre_responsable.replace(/'/g, "''");
|
||||
|
||||
req.body.datos_proyecto.nombre_proyecto = req.body.datos_proyecto.nombre_proyecto.replace(/'/g, "''");
|
||||
req.body.datos_proyecto.nombre_responsable = req.body.datos_proyecto.nombre_responsable.replace(/'/g, "''");
|
||||
req.body.datos_proyecto.disciplina = req.body.datos_proyecto.disciplina.replace(/'/g, "''");
|
||||
req.body.datos_proyecto.objetivo_general = req.body.datos_proyecto.objetivo_general.replace(/'/g, "''");
|
||||
req.body.datos_proyecto.hipotesis = req.body.datos_proyecto.hipotesis.replace(/'/g, "''");
|
||||
req.body.datos_proyecto.resumen = req.body.datos_proyecto.resumen.replace(/'/g, "''");
|
||||
req.body.datos_proyecto.numero_registro = req.body.datos_proyecto.numero_registro.replace(/'/g, "''");
|
||||
if (typeof(req.body.datos_proyecto.disciplina) == typeof(po))
|
||||
req.body.datos_proyecto.disciplina = req.body.datos_proyecto.disciplina.replace(/'/g, "''");
|
||||
if (typeof(req.body.datos_proyecto.objetivo_general) == typeof(po))
|
||||
req.body.datos_proyecto.objetivo_general = req.body.datos_proyecto.objetivo_general.replace(/'/g, "''");
|
||||
if (typeof(req.body.datos_proyecto.hipotesis) == typeof(po))
|
||||
req.body.datos_proyecto.hipotesis = req.body.datos_proyecto.hipotesis.replace(/'/g, "''");
|
||||
if (typeof(req.body.datos_proyecto.resumen) == typeof(po))
|
||||
req.body.datos_proyecto.resumen = req.body.datos_proyecto.resumen.replace(/'/g, "''");
|
||||
if (typeof(req.body.datos_proyecto.numero_registro) == typeof(po))
|
||||
req.body.datos_proyecto.numero_registro = req.body.datos_proyecto.numero_registro.replace(/'/g, "''");
|
||||
|
||||
for (let i = 0; i < req.body.lineas.objetivo_particular.length; i++) {
|
||||
req.body.lineas.objetivo_particular[i].objetivo_texto = req.body.lineas.objetivo_particular[i].objetivo_texto.replace(/'/g, "''");
|
||||
if (typeof(req.body.lineas.objetivo_particular[i].objetivo_texto) == typeof(po))
|
||||
req.body.lineas.objetivo_particular[i].objetivo_texto = req.body.lineas.objetivo_particular[i].objetivo_texto.replace(/'/g, "''");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user