reduccion de lineas de codigo
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user