This commit is contained in:
Lemuel Marquez
2021-01-12 21:09:37 -06:00
parent 2a0f649f59
commit fc77a4d755
16 changed files with 1334 additions and 125 deletions
@@ -17,7 +17,6 @@ const nuevo = async (body) => {
retroalimentacion += body.retroalimentacion[i];
if (i < body.retroalimentacion.length - 1) retroalimentacion += ',';
}
return Servicio.findOne({ where: { idServicio } })
.then((res) => {
if (!res) throw new Error('No existe este Servicio Social.');
@@ -59,15 +58,13 @@ const nuevo = async (body) => {
throw new Error('Este Servicio Social fue cancelado.');
}
})
.then((res) => {
return Servicio.update(
.then((res) =>
Servicio.update(
{ idCuestionarioPrograma: res.idCuestionarioPrograma },
{ where: { idServicio } }
);
})
.then((res) => {
return validar.validarPreTermino(idServicio);
})
)
)
.then((res) => validar.validarPreTermino(idServicio))
.then((res) => {
return { message: `Se guradaron tus respuestas correctamente. ${res}` };
});