Files
inscripciones_api/server/controller/Admin/motivo.js
T
2022-03-18 01:29:10 -06:00

22 lines
598 B
JavaScript

const dbPath = '../../db/tablas';
const Inscripcion = require(`${dbPath}/Inscripcion`);
const { validarNumeroEntero } = require('../../helper/validar');
const motivo = async (body) => {
return Inscripcion.findOne({
where: { folio: body.folio },
})
.then((res) => {
if (!res) throw new Error('No pudimos encontrar este ticket.');
return Inscripcion.findOne({
where: { folio: body.folio },
attributes: ['motivo'],
});
})
.catch((err) => {
throw new Error('No fue posible encontrar el ticket. ' + err);
});
};
module.exports = motivo;