21 lines
576 B
JavaScript
21 lines
576 B
JavaScript
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,
|
|
where: { numeroCuenta: { [Op.like]: `%${body.numeroCuenta}%` } },
|
|
attributes: ['idUsuario', 'numeroCuenta'],
|
|
},
|
|
],
|
|
});
|
|
};
|
|
|
|
module.exports = todasInscripciones;
|