Cambios en la tablas, y agregamos la confirmacion
This commit is contained in:
@@ -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',
|
||||
],
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user