mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-07 05:19:53 -06:00
add ignoreMissing flag to becca's getNotes()
This commit is contained in:
@@ -55,13 +55,17 @@ class Becca {
|
||||
return this.notes[noteId];
|
||||
}
|
||||
|
||||
getNotes(noteIds) {
|
||||
getNotes(noteIds, ignoreMissing = false) {
|
||||
const filteredNotes = [];
|
||||
|
||||
for (const noteId of noteIds) {
|
||||
const note = this.notes[noteId];
|
||||
|
||||
if (!note) {
|
||||
if (ignoreMissing) {
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new Error(`Note '${noteId}' was not found in becca.`);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ function getEditedNotesOnDate(req) {
|
||||
ORDER BY isDeleted
|
||||
LIMIT 50`, {date: req.params.date + '%'});
|
||||
|
||||
const notes = becca.getNotes(noteIds);
|
||||
const notes = becca.getNotes(noteIds, true);
|
||||
|
||||
for (const note of notes) {
|
||||
const notePath = note.isDeleted ? null : beccaService.getNotePath(note.noteId);
|
||||
|
||||
Reference in New Issue
Block a user