carpetas inicio

This commit is contained in:
Lemuel Marquez
2021-01-19 09:39:50 -06:00
parent 81d14c48a1
commit f22ffca48c
3 changed files with 80 additions and 46 deletions
+1 -38
View File
@@ -1,5 +1,4 @@
const csv = require('csvtojson');
const drive = require('../helper/drive');
const Carrera = require('./tablas/Carrera');
const CuestionarioAlumno = require('./tablas/CuestionarioAlumno');
const CuestionarioPrograma = require('./tablas/CuestionarioPrograma');
@@ -311,40 +310,4 @@ const guardar = async () => {
}
};
const carpetasRepetidas = async () => {
let carpetas = await drive.list().then((res) => {
let data = [];
for (let i = 0; i < res.length; i++)
if (res[i].mimeType === 'application/vnd.google-apps.folder')
data.push(res[i]);
data.sort((a, b) => {
return a.name - b.name;
});
return data;
});
let repetidas = [];
for (let i = 0; i < carpetas.length; i++) {
let aux = [carpetas[i]];
for (let j = i + 1; j < carpetas.length; j++) {
if (carpetas[i].name === carpetas[j].name) aux.push(carpetas[j]);
else {
i = j - 1;
break;
}
}
if (aux.length > 1) repetidas.push(aux);
}
// console.log(carpetas.length);
// console.log(carpetas);
console.log(repetidas.length);
console.log(repetidas);
};
const borrarCarpetas = async () => {
let carpetas = [];
};
// guardar();
carpetasRepetidas();
guardar();