sin cerrar conecciones

This commit is contained in:
2020-07-06 01:13:56 -05:00
parent cb7d29ccc8
commit 1b7b9a00e0
+7 -7
View File
@@ -56,7 +56,7 @@ app.post('/registro', async(req, res) => {
let cad = `SELECT * FROM Persona WHERE correo='${n_correo}' AND lider = true;`;
let respuesta = await query(cad);
if (respuesta.length != 0) {
connection.end();
console.log( "El correo del lider ya fue registrado anteriormente");
res.status(400).json({ error: false, msj: "El correo del lider ya fue registrado anteriormente" });
return;
@@ -64,7 +64,7 @@ app.post('/registro', async(req, res) => {
}
catch(error){
connection.end();
let men = `Errror al buscar el correo ${error}`;
console.log(men);
res.status(400).json({ error: true, msj: men });
@@ -80,7 +80,7 @@ app.post('/registro', async(req, res) => {
console.log(`respuesta: ${ans}`);
}
catch(error){
connection.end();
let men = `Error al registar Equipo ${error}`;
console.log(men);
res.status(400).json({ error: true, msj: men });
@@ -110,7 +110,7 @@ app.post('/registro', async(req, res) => {
await query(cad);
}
catch(error){
connection.end();
let men = `Error al registar Integrantes ${error}`
console.log(men);
res.status(400).json({ error: true, msj: men });
@@ -149,14 +149,14 @@ app.post('/registro', async(req, res) => {
let men = `Error al enviar mensaje: ${error}`;
console.log(men);
res.status(400).json({ error: true, msj: men });
connection.end();
return;
} else {
console.log('Email sent: ' + info.response);
res.status(200).json({ error: false, msj: "exito"});
connection.end();
return;
}
@@ -166,7 +166,7 @@ app.post('/registro', async(req, res) => {
let men = `Error al enviar mensaje: ${error}`;
console.log(men);
res.status(400).json({ error: true, msj: men });
connection.end();
return;
}