From 88f00e5071a84233d739a93d0093c4bfcf772d36 Mon Sep 17 00:00:00 2001 From: DanielRamirezGe Date: Sun, 16 Aug 2020 00:19:39 -0500 Subject: [PATCH] cpomprobar equipo --- routes/registro.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/routes/registro.js b/routes/registro.js index 347a1e8..590bfdd 100644 --- a/routes/registro.js +++ b/routes/registro.js @@ -145,6 +145,16 @@ app.post('/registro', async(req, res) => { res.status(400).json({ error: false, msj: "El correo del lider ya fue registrado anteriormente" }); return; } + + cad = `SELECT * FROM Equipo WHERE nombre='${body.nombreEqui}';`; + respuesta = await query(cad); + console.log(respuesta); + if (respuesta.length != 0) { + + console.log( "El nombre del Equipo ya fue registrado anteriormente"); + res.status(400).json({ error: false, msj: "El nombre del Equipo ya fue registrado anteriormente" }); + return; + } } catch(error){