file, monto y folio para poder inscribir

This commit is contained in:
Andres2908
2022-03-06 15:28:10 -06:00
parent d311b3385d
commit 83da896aa4
@@ -14,7 +14,7 @@ const inscripcion = async (body, file) => {
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 = validarAlfanumerico(body.folio, 'folio', true);
const folio = body.folio;
return Inscripcion.findOne({
where: { folio },
@@ -25,7 +25,7 @@ const inscripcion = async (body, file) => {
where: { idUsuario, idArea },
}).then((res) => {
if (res) throw new Error('Ya estas registrado en esta área');
if (file) {
if (file && monto && folio) {
return Inscripcion.create({
idUsuario,
idArea,