From 8bf252ed87f18916d485f8863aade40ee1d85190 Mon Sep 17 00:00:00 2001 From: catarak Date: Wed, 14 Sep 2016 16:23:22 -0400 Subject: [PATCH] fix dbreformat --- server/utils/db_reformat.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/server/utils/db_reformat.js b/server/utils/db_reformat.js index de6f0f06..827167f8 100644 --- a/server/utils/db_reformat.js +++ b/server/utils/db_reformat.js @@ -87,22 +87,26 @@ Project.find({}) .exec((err, projects) => { projects.forEach((project, projectIndex) => { project.files.forEach((file) => { - // if (file.isSelected === true || file.isSelected === false) { - // file.isSelectedFile = file.isSelected; - // delete file.isSelected; + if (file.isSelected === true || file.isSelected === false) { + file.isSelectedFile = file.isSelected; + delete file.isSelected; + console.log(file); + // file.save((err, savedFile) => { + // console.log('file saved'); + // }); + } + // console.log('project', projectIndex); + // if (file.isSelected) { + // console.log('is selected remains'); // } - console.log('project', projectIndex); - if (file.isSelected) { - console.log('is selected remains'); - } - if (file.isSelctedFile) { - console.log('changed to isSelected file'); - } + // if (file.isSelctedFile) { + // console.log('changed to isSelected file'); + // } + }); + project.save((err, savedProject) => { + console.log('project', projectIndex, 'is saved.'); }); - // project.save((err, savedProject) => { - // console.log('project', projectIndex, 'is saved.'); - // }); }); });