const dbPath = '../../db/tablas'; const Inscripcion = require(`${dbPath}/Inscripcion`); const { validarNumeroEntero } = require('../../helper/helper'); const validarSinTicket = async (body) => { const idUsuario = validarNumeroEntero(body.idUsuario, 'usuario', true); return Inscripcion.update( { validacion: 1, }, { where: { idUsuario, }, } ) .then((res) => ({ message: '¡El ticket a sido validado de forma correcta!', })) .catch((err) => { throw new Error('¡ No fue posible validar la inscripción !. '); }); }; module.exports = validarSinTicket;