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
+7 -10
View File
@@ -1,25 +1,22 @@
const {
obtenerIdCarrera,
obtenerCarrera,
} = require('../../config/mariadb.conf');
const validar = require('../../helper/validar');
const { obtenerDatosUsr } = require('../../config/mariadb.conf');
const { validarNumeroEntero } = require('../../helper/validar');
const dbPath = '../../db/tablas';
const Carrera = require(`${dbPath}/Carrera`);
const Usuario = require(`${dbPath}/Usuario`);
const escolares = async (body) => {
// const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta);
const idUsuario = validarNumeroEntero(body.idUsuario, 'id Usuario', true);
return Usuario.findOne({
where: { numeroCuenta: body.numeroCuenta },
}).then((res) => {
if (!res) {
return obtenerIdCarrera(body.numeroCuenta).then(async (res) => {
return obtenerDatosUsr(body.numeroCuenta).then(async (res) => {
return Usuario.create({
idUsuario: body.idUsuario,
idUsuario,
numeroCuenta: body.numeroCuenta,
nombre: body.nombre,
semestre: 8,
generacion: res.generacion,
carrera: body.carrera,
idCarrera: res.id_carrera,
});
@@ -31,7 +28,7 @@ const escolares = async (body) => {
'idUsuario',
'numeroCuenta',
'nombre',
'semestre',
'generacion',
'idCarrera',
'carrera',
],
+2 -2
View File
@@ -1,9 +1,10 @@
const validar = require('../../helper/validar');
const dbPath = '../../db/tablas';
const Carrera = require(`${dbPath}/Carrera`);
const Inscripcion = require(`${dbPath}/Inscripcion`);
const inscripciones = async (body) => {
// const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta);
return Inscripcion.findAll({
where: { idUsuario: body.idUsuario },
}).then((res) => {
@@ -13,7 +14,6 @@ const inscripciones = async (body) => {
attributes: [
'idInscripcion',
'validacion',
'confirmacion',
'folio',
'monto',
'idUsuario',
-1
View File
@@ -13,7 +13,6 @@ const login = async (body) => {
passwordUser: body.passwordUser,
};
console.log(numeroCuenta, body.passwordUser);
return axios
.post(
`https://venus.acatlan.unam.mx/conexionEscolares_test/ingresarAlumno`,