26 lines
629 B
JavaScript
26 lines
629 B
JavaScript
const dbPath = '../../db/tablas';
|
|
const Inscripcion = require(`${dbPath}/Inscripcion`);
|
|
const { validarNumeroEntero } = require('../../helper/validar');
|
|
|
|
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;
|