1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

fix moveNote Api

This commit is contained in:
Dick Choi
2016-08-30 02:33:00 +09:00
parent 33a11ac2e5
commit ba374e08ff
2 changed files with 5 additions and 7 deletions

View File

@@ -65,15 +65,13 @@ function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
noteData.folder = newFolderKey
noteData.key = newNoteKey
noteData.storage = newStorageKey
noteData.updatedAt = new Date()
return noteData
})
.then(function writeAndReturn (noteData) {
CSON.writeFileSync(path.join(newStorage.path, 'notes', noteData.key + '.cson'), _.omit(noteData, ['key', 'storage']))
return {
oldStorageKey: storageKey,
oldNoteKey: noteKey,
note: noteData
}
return noteData
})
.then(function deleteOldNote (data) {
if (storageKey !== newStorageKey) {