validacion en escolares
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const { obtenerDatosUsr } = require('../../config/mariadb.conf');
|
||||
const { validarNumeroEntero } = require('../../helper/validar');
|
||||
const validar = require('../../helper/validar');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Carrera = require(`${dbPath}/Carrera`);
|
||||
const Usuario = require(`${dbPath}/Usuario`);
|
||||
|
||||
const escolares = async (body) => {
|
||||
const idUsuario = validarNumeroEntero(body.idUsuario, 'id Usuario', true);
|
||||
// const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta);
|
||||
|
||||
return Usuario.findOne({
|
||||
where: { numeroCuenta: body.numeroCuenta },
|
||||
@@ -13,7 +13,7 @@ const escolares = async (body) => {
|
||||
if (!res) {
|
||||
return obtenerDatosUsr(body.numeroCuenta).then(async (res) => {
|
||||
return Usuario.create({
|
||||
idUsuario,
|
||||
idUsuario: body.idUsuario,
|
||||
numeroCuenta: body.numeroCuenta,
|
||||
nombre: body.nombre,
|
||||
generacion: res.generacion,
|
||||
|
||||
Reference in New Issue
Block a user