diff --git a/lib/models/note.js b/lib/models/note.js index 2a45513c..ad968e7b 100644 --- a/lib/models/note.js +++ b/lib/models/note.js @@ -92,18 +92,17 @@ module.exports = function (sequelize, DataTypes) { return new Promise(function (resolve, reject) { // if no content specified then use default note if (!note.content) { - var body = null let filePath = config.defaultNotePath if (note.alias) { - const notePathInDocPath = path.join(config.docsPath, path.basename(node.alias) + '.md') + const notePathInDocPath = path.join(config.docsPath, path.basename(note.alias) + '.md') if (Note.checkFileExist(notePathInDocPath)) { filePath = notePathInDocPath } } if (Note.checkFileExist(filePath)) { - let noteInFS = readFileSystemNote(filePath) + const noteInFS = readFileSystemNote(filePath) note.title = noteInFS.title note.content = noteInFS.content if (filePath !== config.defaultNotePath) {