Validaciones y correcciones

This commit is contained in:
Andres2908
2022-02-28 23:32:02 -06:00
parent a00e938335
commit 50edc93b0c
4 changed files with 6 additions and 6 deletions
@@ -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],