Validaciones y correcciones
This commit is contained in:
@@ -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