pre lulu
This commit is contained in:
@@ -9,6 +9,7 @@ const cancelar = async (body) => {
|
||||
let idServicio = validar.validarId(body.idServicio);
|
||||
let mensaje = validar.validarAlfanumerico(body.mensaje, 'El mensaje', 800);
|
||||
let correoResponsable = {};
|
||||
let correoAlumno = {};
|
||||
let emailResponsable = '';
|
||||
|
||||
return Servicio.findOne({
|
||||
@@ -22,11 +23,10 @@ const cancelar = async (body) => {
|
||||
if (!res) throw new Error('No existe este Servicio Social.');
|
||||
switch (res.idStatus) {
|
||||
case 5:
|
||||
let correoAlumno = correos.terminoRechazadoAlumno(
|
||||
correoAlumno = correos.terminoRechazadoAlumno(
|
||||
mensaje,
|
||||
res.Usuario.nombre
|
||||
);
|
||||
|
||||
correoResponsable = correos.terminoRechazadoResponsable(
|
||||
mensaje,
|
||||
res.Usuario.nombre
|
||||
@@ -53,19 +53,15 @@ const cancelar = async (body) => {
|
||||
throw new Error('Este Servicio Social fue cancelado.');
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
return gmail(
|
||||
correoResponsable.subject,
|
||||
emailResponsable,
|
||||
correoResponsable.msj
|
||||
);
|
||||
})
|
||||
.then((res) => {
|
||||
return Servicio.update(
|
||||
{ idStatus: 8, cartaTermino: "" },
|
||||
.then((res) =>
|
||||
gmail(correoResponsable.subject, emailResponsable, correoResponsable.msj)
|
||||
)
|
||||
.then((res) =>
|
||||
Servicio.update(
|
||||
{ idStatus: 8, cartaTermino: '' },
|
||||
{ where: { idServicio } }
|
||||
);
|
||||
})
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
return { message: 'Se rechazo correctamente la Carta de Termino.' };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user