comentarios oscar
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
const { obtenerDatosUsr } = require('../../config/mariadb.conf');
|
||||
const {
|
||||
validarNumeroCuenta,
|
||||
validarNumeroEntero,
|
||||
} = require('../../helper/validar');
|
||||
const { validarNumeroCuenta } = require('../../helper/validar');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Usuario = require(`${dbPath}/Usuario`);
|
||||
|
||||
@@ -17,7 +14,7 @@ const escolares = async (body) => {
|
||||
}).then((res) => {
|
||||
if (!res) {
|
||||
return obtenerDatosUsr(numeroCuenta).then(async (res) => {
|
||||
return Usuario.create({
|
||||
await Usuario.create({
|
||||
numeroCuenta,
|
||||
nombre: body.nombre,
|
||||
generacion: res.generacion,
|
||||
|
||||
@@ -5,16 +5,16 @@ const { crearToken } = require('../../middleware/autentificacion');
|
||||
const Usuario = require('../../db/tablas/Usuario');
|
||||
|
||||
const login = async (body) => {
|
||||
const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta);
|
||||
const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta, 'número de cuenta', true);
|
||||
const data = {
|
||||
usuario: 'votacionesUser',
|
||||
password: 'poasfnr*/049_]',
|
||||
numeroCuenta: numeroCuenta,
|
||||
passwordUser: body.passwordUser,
|
||||
};
|
||||
|
||||
passwordUser: body.passwordUser
|
||||
}
|
||||
|
||||
return axios
|
||||
.post(
|
||||
.post(
|
||||
`https://venus.acatlan.unam.mx/conexionEscolares_test/ingresarAlumno`,
|
||||
data
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user