Seleccion en la tabla

This commit is contained in:
Andres2908
2022-02-10 00:44:23 -06:00
parent a157df8966
commit fe3d5c4f91
6 changed files with 13 additions and 10 deletions
@@ -1,10 +1,12 @@
const validar = require('../../helper/validar');
const { Op } = require('sequelize');
const dbPath = '../../db/tablas';
const Usuario = require(`${dbPath}/Usuario`);
const Inscripcion = require(`${dbPath}/Inscripcion`);
const todasInscripciones = async (body) => {
return Inscripcion.findAll({
where: { validacion: body.validacion },
include: [
{
model: Usuario,
+1 -1
View File
@@ -21,7 +21,7 @@ const validarTicket = async (body) => {
})
.then((res) => {
console.log(body.validacion);
if (body.validacion === false)
if (body.validacion === 0)
throw new Error('El administrador a declinado el ticket');
})
.then((res) => ({
@@ -49,7 +49,8 @@ const inscripcion = async (body, file) => {
fs.renameSync(file.path, file.path + '.' + file.mimetype.split('/')[1]);
})
.then((res) => ({
message: '¡La inscripción se realizo de manera correcta!',
message:
'¡La inscripción se realizo de manera correcta! Confirma en el siguiente sitio web tu inscripción: <a href="https://kalinga.acatlan.unam.mx/cedetec/" target="_blank">Kalinga</a>',
}))
.catch((err) => {
if (file) eliminarArchivo(file.path);
+2 -3
View File
@@ -15,9 +15,8 @@ Inscripcion.init(
autoIncrement: true,
},
validacion: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
type: DataTypes.INTEGER,
defaultValue: 2,
},
confirmacion: {
type: DataTypes.BOOLEAN,
-1
View File
@@ -34,7 +34,6 @@ app.get(`${route}/ticket`, (req, res) => {
return ticket(req.query)
.then((data) => {
res.writeHead(200, { 'content-type': `image/png` });
console.log(data);
fs.createReadStream(
process.cwd() + '/' + data.rutaTicket + '.' + data.extension
).pipe(res);
+6 -4
View File
@@ -1,5 +1,7 @@
idInscripcion,validacion,confirmacion,folio,monto,fechaInscripcion,idArea
1,false,false,7410,12,Thu Feb 03 2022 22:45:50 GMT-0600 (hora estándar central),1
2,true,false,9630,85,Thu Feb 03 2022 22:55:00 GMT-0600 (hora estándar central),3
3,true,false,8520,89,Fri Feb 04 2022 22:51:02 GMT-0600 (hora estándar central),1
4,"",false,9654,89,Fri Feb 04 2022 23:19:48 GMT-0600 (hora estándar central),3
1,"",false,7410,1,Wed Feb 09 2022 21:28:01 GMT-0600 (hora estándar central),3
2,"",false,8555,98,Wed Feb 09 2022 21:30:16 GMT-0600 (hora estándar central),1
3,"",false,5555,6,Wed Feb 09 2022 21:30:48 GMT-0600 (hora estándar central),1
4,"",false,7899,63,Wed Feb 09 2022 21:31:00 GMT-0600 (hora estándar central),3
5,"",false,7778,8,Wed Feb 09 2022 21:45:45 GMT-0600 (hora estándar central),1
6,"",false,9898,6633,Wed Feb 09 2022 21:46:01 GMT-0600 (hora estándar central),3
1 idInscripcion validacion confirmacion folio monto fechaInscripcion idArea
2 1 false false 7410 12 1 Thu Feb 03 2022 22:45:50 GMT-0600 (hora estándar central) Wed Feb 09 2022 21:28:01 GMT-0600 (hora estándar central) 1 3
3 2 true false 9630 8555 85 98 Thu Feb 03 2022 22:55:00 GMT-0600 (hora estándar central) Wed Feb 09 2022 21:30:16 GMT-0600 (hora estándar central) 3 1
4 3 true false 8520 5555 89 6 Fri Feb 04 2022 22:51:02 GMT-0600 (hora estándar central) Wed Feb 09 2022 21:30:48 GMT-0600 (hora estándar central) 1
5 4 false 9654 7899 89 63 Fri Feb 04 2022 23:19:48 GMT-0600 (hora estándar central) Wed Feb 09 2022 21:31:00 GMT-0600 (hora estándar central) 3
6 5 false 7778 8 Wed Feb 09 2022 21:45:45 GMT-0600 (hora estándar central) 1
7 6 false 9898 6633 Wed Feb 09 2022 21:46:01 GMT-0600 (hora estándar central) 3