manejo de errores y validacion sin ticket
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
const moment = require('moment');
|
||||
const fs = require('fs');
|
||||
const {
|
||||
validarNumeroEntero,
|
||||
validarNumero,
|
||||
validarAlfanumerico,
|
||||
} = require('../../helper/validar');
|
||||
const { validarNumeroEntero, validarNumero } = require('../../helper/validar');
|
||||
const { eliminarArchivo } = require('../../helper/helper');
|
||||
const { usuarioInscrito } = require('../../config/mariadb.conf');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Inscripcion = require(`${dbPath}/Inscripcion`);
|
||||
|
||||
@@ -25,7 +22,7 @@ const inscripcion = async (body, file) => {
|
||||
where: { idUsuario, idArea },
|
||||
}).then((res) => {
|
||||
if (res) throw new Error('Ya estas registrado en esta área');
|
||||
if (file && monto && folio) {
|
||||
if (file && folio && body.fechaTicket) {
|
||||
return Inscripcion.create({
|
||||
idUsuario,
|
||||
idArea,
|
||||
@@ -40,6 +37,7 @@ const inscripcion = async (body, file) => {
|
||||
} else {
|
||||
return Inscripcion.create({
|
||||
idUsuario,
|
||||
validacion: 1,
|
||||
idArea,
|
||||
hizoPago: false,
|
||||
fechaInscripcion: ahora.format(),
|
||||
|
||||
@@ -4,7 +4,6 @@ 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) => {
|
||||
|
||||
Reference in New Issue
Block a user