validacion y reporte
This commit is contained in:
@@ -3,16 +3,15 @@ const dbPath = '../../db/tablas';
|
||||
const Inscripcion = require(`${dbPath}/Inscripcion`);
|
||||
|
||||
const validarTicket = async (body) => {
|
||||
const validacion = validarNumeroEntero(body.validacion, 'validacion', true);
|
||||
const folio = validarNumeroEntero(body.folio, 'folio', true);
|
||||
|
||||
return Inscripcion.findOne({
|
||||
where: { folio: body.folio },
|
||||
where: { folio },
|
||||
})
|
||||
.then((res) => {
|
||||
if (!res) throw new Error('Este folio no existe');
|
||||
idUsuario = res.idUsuario;
|
||||
if (validacion == 1) {
|
||||
if (body.validacion == 1) {
|
||||
return Inscripcion.findOne({
|
||||
where: { folio, validacion: 1 },
|
||||
});
|
||||
@@ -22,7 +21,7 @@ const validarTicket = async (body) => {
|
||||
if (res) throw new Error('Este folio ya fue validado');
|
||||
return Inscripcion.update(
|
||||
{
|
||||
validacion,
|
||||
validacion: body.validacion,
|
||||
},
|
||||
{
|
||||
where: {
|
||||
@@ -37,7 +36,7 @@ const validarTicket = async (body) => {
|
||||
{ motivo: body.motivo },
|
||||
{
|
||||
where: {
|
||||
folio: body.folio,
|
||||
folio,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user