mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
fix setNoteToParent API method, closes #360
This commit is contained in:
@@ -113,8 +113,8 @@ async function sortNotesAlphabetically(parentNoteId) {
|
||||
async function setNoteToParent(noteId, prefix, parentNoteId) {
|
||||
const parentNote = await repository.getNote(parentNoteId);
|
||||
|
||||
if (parentNote.isDeleted) {
|
||||
throw new Error("Cannot move note to deleted parent note");
|
||||
if (parentNote && parentNote.isDeleted) {
|
||||
throw new Error(`Cannot move note to deleted parent note ${parentNoteId}`);
|
||||
}
|
||||
|
||||
// case where there might be more such branches is ignored. It's expected there should be just one
|
||||
|
||||
Reference in New Issue
Block a user