20 lines
595 B
JavaScript
20 lines
595 B
JavaScript
const helperPath = '../../helper';
|
|
const validar = require(`${helperPath}/validar`);
|
|
const dbPath = '../../db/tablas';
|
|
const Carrera = require(`${dbPath}/Carrera`);
|
|
const Grupo = require(`${dbPath}/Grupo`);
|
|
const TercerSemestre = require(`${dbPath}/TercerSemestre`);
|
|
|
|
const asistentes = async (body) => {
|
|
const idGrupo = validar.validarId(body.idGrupo);
|
|
|
|
return Grupo.findOne({ where: { idGrupo } }).then((res) => {
|
|
return TercerSemestre.findAll({
|
|
where: { idGrupo },
|
|
include: [{ model: Grupo, include: [{ model: Carrera }] }],
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = asistentes;
|