This commit is contained in:
Lemuel Marquez
2021-01-13 12:00:11 -06:00
parent ff6699ff20
commit 5de85194fe
8 changed files with 53 additions and 75 deletions
+9 -14
View File
@@ -15,6 +15,7 @@ const registroValidado = async (body) => {
200
);
let correoResponsable = {};
let correoAlumno = {};
let emailResponsable = '';
return Servicio.findOne({
@@ -26,11 +27,9 @@ const registroValidado = async (body) => {
})
.then((res) => {
if (!res) throw new Error('No existe este Servicio Social.');
switch (res.idStatus) {
case 2:
let correoAlumno = correos.registroValidadoAlumno(res.Usuario.nombre);
correoAlumno = correos.registroValidadoAlumno(res.Usuario.nombre);
correoResponsable = correos.registroValidadoResponsable(
res.Usuario.nombre
);
@@ -63,20 +62,16 @@ const registroValidado = async (body) => {
);
}
})
.then((res) => {
return gmail(
correoResponsable.subject,
emailResponsable,
correoResponsable.msj
);
})
.then((res) => {
return Servicio.update(
.then((res) =>
gmail(correoResponsable.subject, emailResponsable, correoResponsable.msj)
)
.then((res) =>
Servicio.update(
// { idStatus: 3, direccion, telefono, fechaNacimiento },
{ idStatus: 4, direccion, telefono, fechaNacimiento },
{ where: { idServicio } }
);
})
)
)
.then((res) => {
return {
message: