File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ module.exports = function (sequelize, DataTypes) {
9797 if ( ! note . alias ) {
9898 filePath = config . defaultNotePath
9999 } else {
100- filePath = path . join ( config . docsPath , note . alias + '.md' )
100+ filePath = path . join ( config . docsPath , path . basename ( node . alias ) + '.md' )
101101 }
102102 if ( Note . checkFileExist ( filePath ) ) {
103103 var fsCreatedTime = moment ( fs . statSync ( filePath ) . ctime )
@@ -206,7 +206,7 @@ module.exports = function (sequelize, DataTypes) {
206206 }
207207 } ) . then ( function ( note ) {
208208 if ( note ) {
209- const filePath = path . join ( config . docsPath , noteId + '.md' )
209+ const filePath = path . join ( config . docsPath , path . basename ( noteId ) + '.md' )
210210 if ( Note . checkFileExist ( filePath ) ) {
211211 // if doc in filesystem have newer modified time than last change time
212212 // then will update the doc in db
@@ -248,7 +248,7 @@ module.exports = function (sequelize, DataTypes) {
248248 return callback ( null , note . id )
249249 }
250250 } else {
251- var filePath = path . join ( config . docsPath , noteId + '.md' )
251+ var filePath = path . join ( config . docsPath , path . basename ( noteId ) + '.md' )
252252 if ( Note . checkFileExist ( filePath ) ) {
253253 Note . create ( {
254254 alias : noteId ,
You can’t perform that action at this time.
0 commit comments