get info alumno
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
const validar = require('../../helper/validar');
|
||||
const Servicio = require('../../db/tablas/Servicio');
|
||||
const Usuario = require('../../db/tablas/Usuario');
|
||||
const TipoUsuario = require('../../db/tablas/TipoUsuario');
|
||||
const Carrera = require('../../db/tablas/Carrera');
|
||||
const Status = require('../../db/tablas/Status');
|
||||
const Programa = require('../../db/tablas/Programa');
|
||||
|
||||
const admin = (body) => {
|
||||
let idServicio = validar.validarId(body.idServicio);
|
||||
|
||||
return Servicio.findOne({
|
||||
where: { idServicio },
|
||||
include: [
|
||||
{ model: Usuario, include: [{ model: TipoUsuario }] },
|
||||
{ model: Carrera },
|
||||
{ model: Status },
|
||||
{ model: Programa },
|
||||
],
|
||||
}).then((res) => {
|
||||
if (!res) throw new Error('No existe este servicio social.');
|
||||
return {
|
||||
idServicio: res.idServicio,
|
||||
creditos: res.creditos,
|
||||
correo: res.correo,
|
||||
telefono: res.telefono,
|
||||
direccion: res.direccion,
|
||||
fechaInicio: res.fechaInicio,
|
||||
fechaFin: res.fechaFin,
|
||||
fechaNacimiento: res.fechaNacimiento,
|
||||
carpeta: res.carpeta,
|
||||
cartaAceptacion: res.cartaAceptacion,
|
||||
cartaTermino: res.cartaTermino,
|
||||
informeGlobal: res.informeGlobal,
|
||||
programaInterno: res.programaInterno,
|
||||
profesor: res.profesor,
|
||||
vistoBuenoAcatlan: res.vistoBuenoAcatlan,
|
||||
idCuestionarioAlumno: res.idCuestionarioAlumno,
|
||||
idCuestionarioPrograma: res.idCuestionarioPrograma,
|
||||
Usuario: {
|
||||
idUsuario: res.Usuario.idUsuario,
|
||||
usuario: res.Usuario.usuario,
|
||||
password: res.Usuario.password,
|
||||
nombre: res.Usuario.nombre,
|
||||
activo: res.Usuario.activo,
|
||||
TipoUsuario: {
|
||||
idTipoUsuario: res.Usuario.TipoUsuario.idTipoUsuario,
|
||||
tipoUsuario: res.Usuario.TipoUsuario.tipoUsuario,
|
||||
},
|
||||
},
|
||||
Carrera: {
|
||||
idCarrera: res.Carrera.idCarrera,
|
||||
carrera: res.Carrera.carrera,
|
||||
},
|
||||
Status: {
|
||||
idStatus: res.Status.idStatus,
|
||||
status: res.Status.status,
|
||||
},
|
||||
Programa: {
|
||||
idPrograma: res.Programa.idPrograma,
|
||||
institucion: res.Programa.institucion,
|
||||
dependencia: res.Programa.dependencia,
|
||||
programa: res.Programa.programa,
|
||||
clavePrograma: res.Programa.clavePrograma,
|
||||
acatlan: res.Programa.acatlan,
|
||||
activo: res.Programa.activo,
|
||||
idUsuario: res.Programa.idUsuario,
|
||||
},
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = admin;
|
||||
Reference in New Issue
Block a user