even more db reformat

This commit is contained in:
catarak 2016-09-14 16:30:50 -04:00
parent f1ec50d914
commit fcf09c6779

View file

@ -87,6 +87,11 @@ Project.find({})
.exec((err, projects) => { .exec((err, projects) => {
projects.forEach((project, projectIndex) => { projects.forEach((project, projectIndex) => {
project.files.forEach((file) => { project.files.forEach((file) => {
if (file.isSelected && !file.isSelectedFile) {
file.isSelectedFile = file.isSelected;
delete file.isSelected;
}
if (file.name === 'sketch.js') { if (file.name === 'sketch.js') {
file.isSelectedFile = true; file.isSelectedFile = true;
delete file.isSelected; delete file.isSelected;
@ -105,9 +110,9 @@ Project.find({})
// if (file.isSelctedFile) { // if (file.isSelctedFile) {
// console.log('changed to isSelected file'); // console.log('changed to isSelected file');
// } // }
}); project.save((err, savedProject) => {
project.save((err, savedProject) => { console.log('project', projectIndex, 'is saved.');
console.log('project', projectIndex, 'is saved.'); });
}); });
}); });
}); });