primer semestre listo

This commit is contained in:
2021-07-13 18:39:13 -05:00
parent 539ef950d0
commit 90888eed4b
3 changed files with 8 additions and 8 deletions
@@ -15,14 +15,9 @@ const get = async (body) => {
const idHorario = validar.validarId(body.idHorario);
const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta);
const correo = validar.validarCorreo(body.correo);
const nombre = validar.validarTexto(body.nombre, 'El nombre', 70);
let mail = {};
/*
Falta
Enviar correo con qr de confirmación de su registro a su
email
*/
return Carrera.findOne({ where: { idCarrera } })
.then((res) => {
if (!res) throw new Error('No existe esta carrera.');
@@ -63,12 +58,13 @@ const get = async (body) => {
return PrimerSemestre.create({
numeroCuenta,
correo,
nombre,
idHorario,
idGrupo,
});
})
.then((res) => {
mail = correo = correos(res.nombre, res.numeroCuenta);
mail = correos(res.nombre, res.numeroCuenta);
gmail(mail.subject, res.correo, mail.message);
})
.then((res) => ({
+4
View File
@@ -18,6 +18,10 @@ PrimerSemestre.init(
allowNull: false,
unique: true,
},
nombre: {
type: DataTypes.STRING(70),
allowNull: false,
},
correo: {
type: DataTypes.STRING(60),
allowNull: false,
+1 -1
View File
@@ -9,7 +9,7 @@ const gmail = (subject, to, html) => {
return new Promise((resolve, reject) => {
send({ subject, to, html }, (error, result, fullResult) => {
if (error) reject(error);
console.log(fullResult);
// console.log(fullResult);
resolve(result);
});
});