From 94fbd2a2b1a0a8446b1574a4d5b4c3671b47cca2 Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Tue, 8 Dec 2020 18:43:06 -0600 Subject: [PATCH] error al resubir pdf --- server/controller/Servicio/cartaAceptacion.js | 12 ++++++------ server/controller/Servicio/cartaTermino.js | 9 +++++++-- server/controller/Servicio/informeGlobal.js | 9 +++++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/server/controller/Servicio/cartaAceptacion.js b/server/controller/Servicio/cartaAceptacion.js index 1a5bf58..af3ac3d 100644 --- a/server/controller/Servicio/cartaAceptacion.js +++ b/server/controller/Servicio/cartaAceptacion.js @@ -20,7 +20,7 @@ const cartaTermino = async (body, file) => { return drive.uploadFile( path, - `Carta_Termino.pdf`, + `Carta_Aceptacion.pdf`, 'application/pdf', res.carpeta ); @@ -49,14 +49,14 @@ const cartaTermino = async (body, file) => { } }) .then((res) => { - return Servicio.update({ cartaTermino: res }, { where: { idServicio } }); - }) - .then((res) => { - return validar.validarPreTermino(idServicio); + return Servicio.update( + { cartaAceptacion: res, idStatus: 1 }, + { where: { idServicio } } + ); }) .then((res) => { return { - message: `Se subio la Carta de Aceptación correctamente. ${res}`, + message: `Se subio la Carta de Aceptación correctamente.`, }; }); }; diff --git a/server/controller/Servicio/cartaTermino.js b/server/controller/Servicio/cartaTermino.js index c35be58..81c2a2d 100644 --- a/server/controller/Servicio/cartaTermino.js +++ b/server/controller/Servicio/cartaTermino.js @@ -42,11 +42,16 @@ const cartaTermino = async (body, file) => { 'Este Servicio Social se encuentra rechazado. No se puede avanzar hasta que se corriga lo necesario.' ); case 10: - throw new Error('Este Servicio Social esta cancelado. Comunicate con COESI para solucionar tu problema.'); + throw new Error( + 'Este Servicio Social esta cancelado. Comunicate con COESI para solucionar tu problema.' + ); } }) .then((res) => { - return Servicio.update({ cartaTermino: res }, { where: { idServicio } }); + return Servicio.update( + { cartaTermino: res, idStatus: 5 }, + { where: { idServicio } } + ); }) .then((res) => { return validar.validarPreTermino(idServicio); diff --git a/server/controller/Servicio/informeGlobal.js b/server/controller/Servicio/informeGlobal.js index bcccf9f..9a75da7 100644 --- a/server/controller/Servicio/informeGlobal.js +++ b/server/controller/Servicio/informeGlobal.js @@ -44,11 +44,16 @@ const informeGlobal = async (body, file) => { 'Este Servicio Social se encuentra rechazado. No se puede avanzar hasta que se corriga lo necesario.' ); case 10: - throw new Error('Este Servicio Social esta cancelado. Comunicate con COESI para solucionar tu problema.'); + throw new Error( + 'Este Servicio Social esta cancelado. Comunicate con COESI para solucionar tu problema.' + ); } }) .then((res) => { - return Servicio.update({ informeGlobal: res }, { where: { idServicio } }); + return Servicio.update( + { informeGlobal: res, idStatus: 5 }, + { where: { idServicio } } + ); }) .then(async (res) => { return validar.validarPreTermino(idServicio);