From 03e2fd32c5f3f36839eb5f816a02a3cde3286468 Mon Sep 17 00:00:00 2001 From: catarak Date: Wed, 14 Sep 2016 16:33:47 -0400 Subject: [PATCH] more db testing stuff --- server/utils/db_reformat.js | 50 ++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/server/utils/db_reformat.js b/server/utils/db_reformat.js index 03d2d4a8..4b61f7c6 100644 --- a/server/utils/db_reformat.js +++ b/server/utils/db_reformat.js @@ -87,32 +87,36 @@ Project.find({}) .exec((err, projects) => { projects.forEach((project, projectIndex) => { project.files.forEach((file) => { - if (file.isSelected && !file.isSelectedFile) { - file.isSelectedFile = file.isSelected; - delete file.isSelected; - } - - if (file.name === 'sketch.js') { - file.isSelectedFile = true; - delete file.isSelected; - console.log(file); - // file.save((err, savedFile) => { - // console.log('file saved'); - // }); - } else { - file.isSelctedFile = false; - } - // console.log('project', projectIndex); - // if (file.isSelected) { - // console.log('is selected remains'); + // if (file.isSelected && !file.isSelectedFile) { + // file.isSelectedFile = file.isSelected; + // delete file.isSelected; // } - // if (file.isSelctedFile) { - // console.log('changed to isSelected file'); + // if (file.name === 'sketch.js') { + // file.isSelectedFile = true; + // delete file.isSelected; + // console.log(file); + // // file.save((err, savedFile) => { + // // console.log('file saved'); + // // }); + // } else { + // file.isSelctedFile = false; // } - project.save((err, savedProject) => { - console.log('project', projectIndex, 'is saved.'); - }); + // // console.log('project', projectIndex); + // // if (file.isSelected) { + // // console.log('is selected remains'); + // // } + + // // if (file.isSelctedFile) { + // // console.log('changed to isSelected file'); + // // } + // project.save((err, savedProject) => { + // console.log('project', projectIndex, 'is saved.'); + // }); + + if (file.fileType === 'folder' && file.isSelctedFile) { + console.log('there is an error'); + } }); }); });