reduccion de lineas de codigo

This commit is contained in:
Lemuel Marquez
2021-01-14 03:13:37 -06:00
parent 5de85194fe
commit 0de481b596
32 changed files with 182 additions and 1553 deletions
+6 -6
View File
@@ -6,9 +6,9 @@ const Usuario = require('../../db/tablas/Usuario');
const Programa = require('../../db/tablas/Programa');
const liberacion = async (body) => {
let idServicio = validar.validarId(body.idServicio);
const idServicio = validar.validarId(body.idServicio);
const update = { idStatus: 6 };
let correo = {};
let update = { idStatus: 6 };
return Servicio.findOne({
where: { idServicio },
@@ -16,10 +16,10 @@ const liberacion = async (body) => {
})
.then(async (res) => {
if (!res) throw new Error('No existe este Servicio Social.');
// if (res.Programa.acatlan && !body.vistoBuenoAcatlan)
// throw new Error(
// 'El programa de este Servicio Social es Acatlán Contigo y no se envio la variable validando este servicio.'
// );
if (res.Programa.acatlan && !body.vistoBuenoAcatlan)
throw new Error(
'El programa de este Servicio Social es Acatlán Contigo y no se envio la variable validando este servicio.'
);
switch (res.idStatus) {
case 5:
correo = correos.terminoValidado(res.Usuario.nombre);