nuevos cuestionarios de programa y alumno, sql de update, falta revisar el proceso de servicio para actualizar el get de los id cuestionarios

This commit is contained in:
Your Name
2025-01-22 11:24:19 -06:00
parent 2fc5c1f5fa
commit bea8a7b266
25 changed files with 3114 additions and 2156 deletions
@@ -1,5 +1,5 @@
const helperPath = '../../helper';
const drive = require(`${helperPath}/drive`);
//const drive = require(`${helperPath}/drive`);
const validar = require(`${helperPath}/validar`);
const Servicio = require('../../db/tablas/Servicio');
@@ -23,13 +23,13 @@ const cartaTermino = async (body, file) => {
if (res.cartaAceptacion)
throw new Error('Ya se subio la Carta de Aceptación.');
switch (res.idStatus) {
case 7:
/* case 7:
return drive.uploadFile(
path,
`Carta_Aceptacion.pdf`,
'application/pdf',
res.carpeta
);
); */
case 1:
throw new Error(
'Esta linea de la API solo puede ser usada cuando es estatus del Servicio Social sea 7.'
+3 -3
View File
@@ -1,5 +1,5 @@
const helperPath = '../../helper';
const drive = require(`${helperPath}/drive`);
//const drive = require(`${helperPath}/drive`);
const validar = require(`${helperPath}/validar`);
const Servicio = require('../../db/tablas/Servicio');
@@ -23,13 +23,13 @@ const cartaTermino = async (body, file) => {
if (res.cartaTermino) throw new Error('Ya se subio la Carta de Termino.');
switch (res.idStatus) {
case 4:
case 8:
/* case 8:
return drive.uploadFile(
path,
`Carta_Termino.pdf`,
'application/pdf',
res.carpeta
);
); */
case 1:
case 2:
case 3:
+3 -3
View File
@@ -1,5 +1,5 @@
const helperPath = '../../helper';
const drive = require(`${helperPath}/drive`);
//const drive = require(`${helperPath}/drive`);
const validar = require(`${helperPath}/validar`);
const Servicio = require('../../db/tablas/Servicio');
@@ -23,13 +23,13 @@ const informeGlobal = async (body, file) => {
if (res.informeGlobal) throw new Error('Ya se subio el Informe Global.');
switch (res.idStatus) {
case 4:
case 9:
/* case 9:
return drive.uploadFile(
path,
`Informe_Global.pdf`,
'application/pdf',
res.carpeta
);
); */
case 1:
case 2:
case 3:
+3 -3
View File
@@ -1,6 +1,6 @@
const { Op } = require('sequelize');
const helperPath = '../../helper';
const drive = require(`${helperPath}/drive`);
//const drive = require(`${helperPath}/drive`);
const validar = require(`${helperPath}/validar`);
const dbPath = '../../db/tablas';
const Carrera = require(`${dbPath}/Carrera`);
@@ -79,7 +79,7 @@ const nuevo = async (body, file) => {
.then((servicio) => {
let carpeta = '';
drive
/* drive
.mkDir(numeroCuenta)
.then((res) => {
carpeta = res;
@@ -95,7 +95,7 @@ const nuevo = async (body, file) => {
{ carpeta, cartaAceptacion: res },
{ where: { idServicio: servicio.idServicio } }
)
);
); */
return { message: `Se Pre-Registro correctamente a este alumno.` };
});
};
+6 -1
View File
@@ -1,5 +1,5 @@
const helperPath = '../../helper';
const drive = require(`${helperPath}/drive`);
//const drive = require(`${helperPath}/drive`);
const validar = require(`${helperPath}/validar`);
const Servicio = require('../../db/tablas/Servicio');
@@ -13,6 +13,8 @@ const update = async (body, files) => {
return Servicio.findOne({ where: { idServicio } })
.then(async (res) => {
if (!res) throw new Error('Este Servicio Social no existe en la db.');
/*
try {
if (files['cartaAceptacion'][0].filename)
dataUpdate.cartaAceptacion = await drive.uploadFile(
@@ -40,6 +42,9 @@ const update = async (body, files) => {
res.carpeta
);
} catch (err) {}
*/
if (body.correo) dataUpdate.correo = validar.validarCorreo(body.correo);
if (body.fechaInicio)
dataUpdate.fechaInicio = validar.validarFecha(