Cambios en la tablas, y agregamos la confirmacion

This commit is contained in:
Andres2908
2022-03-15 00:23:09 -06:00
parent 80852bb2c9
commit e8305da5a3
6 changed files with 18 additions and 23 deletions
+5 -5
View File
@@ -8,17 +8,17 @@ const pool = mariadb.createPool({
database: process.env.SAT_DB,
});
const obtenerIdCarrera = async (numeroCuenta) => {
const obtenerDatosUsr = async (numeroCuenta) => {
const conn = await pool.getConnection().catch((err) => {
throw new Error('No se pudo conectar con la db. ' + err);
});
return conn
.query(`SELECT id_carrera FROM alumno WHERE id_cuenta = ${numeroCuenta}`)
.query(
`SELECT id_carrera, generacion FROM alumno WHERE id_cuenta = ${numeroCuenta}`
)
.then((rows) => {
conn.end();
// console.log(rows[0]);
// if (rows[0].length === 0) return null;
return rows[0];
})
.catch((err) => {
@@ -63,4 +63,4 @@ const usuarioInscrito = async (numeroCuenta, realizoPago) => {
});
};
module.exports = { obtenerIdCarrera, obtenerCarrera, usuarioInscrito };
module.exports = { obtenerDatosUsr, obtenerCarrera, usuarioInscrito };