Validaciones y correcciones
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const moment = require('moment');
|
||||
const { convertArrayToCSV } = require('convert-array-to-csv');
|
||||
const { Op, where } = require('sequelize');
|
||||
const { Op } = require('sequelize');
|
||||
const helperPath = '../../helper';
|
||||
const helper = require(`${helperPath}/helper`);
|
||||
const validar = require(`${helperPath}/validar`);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// const validar = require('../../../helper/validar');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Usuario = require(`${dbPath}/Usuario`);
|
||||
const Inscripcion = require(`${dbPath}/Inscripcion`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const moment = require('moment');
|
||||
const fs = require('fs');
|
||||
const { validarNumeroEntero } = require('../../helper/validar');
|
||||
const { validarNumeroEntero, validarNumero } = require('../../helper/validar');
|
||||
const { eliminarArchivo } = require('../../helper/helper');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Carrera = require(`${dbPath}/Carrera`);
|
||||
@@ -10,6 +10,7 @@ const inscripcion = async (body, file) => {
|
||||
const ahora = moment();
|
||||
const idUsuario = validarNumeroEntero(body.idUsuario, 'id Usuario', true);
|
||||
const idArea = validarNumeroEntero(body.idArea, 'id Area', true);
|
||||
const monto = validarNumero(body.monto, 'monto', true);
|
||||
const folio = body.folio;
|
||||
|
||||
return Inscripcion.findOne({
|
||||
@@ -26,7 +27,7 @@ const inscripcion = async (body, file) => {
|
||||
idUsuario,
|
||||
idArea,
|
||||
folio,
|
||||
monto: body.monto,
|
||||
monto,
|
||||
hizoPago: true,
|
||||
rutaTicket: file.path,
|
||||
extension: file.mimetype.split('/')[1],
|
||||
|
||||
Reference in New Issue
Block a user