1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Cli: Fixes #5435: Setting note contents using "set" command does not update note timestamp

This commit is contained in:
Laurent Cozic 2021-09-08 10:32:44 +01:00
parent 261009771c
commit 9ebec8c178

View File

@ -34,18 +34,19 @@ class Command extends BaseCommand {
for (let i = 0; i < notes.length; i++) { for (let i = 0; i < notes.length; i++) {
this.encryptionCheck(notes[i]); this.encryptionCheck(notes[i]);
const timestamp = Date.now();
const newNote = { const newNote = {
id: notes[i].id, id: notes[i].id,
type_: notes[i].type_, type_: notes[i].type_,
updated_time: timestamp,
}; };
newNote[propName] = propValue; newNote[propName] = propValue;
const timestamp = Date.now(); if (!newNote.id) newNote.created_time = timestamp;
await Note.save(newNote, { await Note.save(newNote, {
autoTimestamp: false, // No auto-timestamp because user may have provided them autoTimestamp: false, // No auto-timestamp because user may have provided them
updated_time: timestamp,
created_time: timestamp,
}); });
} }
} }