From 7401c7b06142465d64ee49af51b72e32728db1df Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Wed, 20 Jan 2021 00:57:44 -0600 Subject: [PATCH] encomendado a dios --- server/db/capetasDrive.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/db/capetasDrive.js b/server/db/capetasDrive.js index 2c6c617..864bb11 100644 --- a/server/db/capetasDrive.js +++ b/server/db/capetasDrive.js @@ -27,7 +27,7 @@ const borrarCarpetas = async () => { for (let i = 0; i < res.length; i++) { let carpetasAlumno = buscarCarpetas(carpetas, res[i].usuario); - console.log(`${(100 * i) / res.length}%`); + console.log(`${(100 * (i + 1)) / res.length}%`); console.log( `El numero de cuenta ${res[i].usuario} tiene ${ carpetasAlumno.length @@ -37,10 +37,10 @@ const borrarCarpetas = async () => { console.log( `La carpeta ${carpetasAlumno[0].name} con la que nos quedaremos es ${carpetasAlumno[0].id}.` ); - // await Servicio.update( - // { carpeta: carpetasAlumno[0].id }, - // { where: { idUsuario: res[i].idUsuario } } - // ); + await Servicio.update( + { carpeta: carpetasAlumno[0].id }, + { where: { idUsuario: res[i].idUsuario } } + ); } if (carpetasAlumno.length > 1) { for (let j = 1; j < carpetasAlumno.length; j++) { @@ -52,16 +52,16 @@ const borrarCarpetas = async () => { } archivo${archivosCarpeta.length > 1 ? 's' : ''}.` ); for (let k = 0; k < archivosCarpeta.length; k++) { - // await drive.update( - // archivosCarpeta[k].id, - // carpetasAlumno[0].id, - // carpetasAlumno[j].id - // ); + await drive.update( + archivosCarpeta[k].id, + carpetasAlumno[0].id, + carpetasAlumno[j].id + ); console.log( - `Se movio el archivo ${archivosCarpeta[k].name} con id ${archivosCarpeta[k].id} de la carpeta ${carpetasAlumno[j].id} a la carpeta ${carpetasAlumno[0].id}` + `Se movio el archivo ${archivosCarpeta[k].name} con id ${archivosCarpeta[k].id} de la carpeta ${carpetasAlumno[j].id} a la carpeta ${carpetasAlumno[0].id}.` ); } - // await drive.deleteFile(carpetasAlumno[j].id); + await drive.deleteFile(carpetasAlumno[j].id); console.log(`Se elimino la carpeta con id ${carpetasAlumno[j].id}`); } }