-
I am trying to move a note in the tree |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi, what about this (roughly)? const note = ... // note I want to move
const originalParentNoteId = note.getParentNotes()[0].parentNoteId;
api.toggleInParent(true, note.noteId, newParentNoteId); // clone to new location
api.toggleInParent(false, note.noteId, originalParentNoteId); // remove the old location |
Beta Was this translation helpful? Give feedback.
-
I'm also trying to move a note programmatically but couldn't find any way. module.exports = async function (noteId) {
const note = await api.getNote(noteId);
if (!note) {
return;
}
if (note.getParentNotes().some((m) => m.hasLabel("todoArchive"))) {
return;
}
const todoDoneId = (
await note.getParentNotes()[0].getParentNotes()[0].getChildNotes()
).find((m) => m.hasLabel("todoDone"))?.noteId;
if (!todoDoneId) {
return;
}
note.removeLabel("timeLeft");
await api.toggleNoteInParent(false, note.noteId, todoDoneId);
}; If I set the first argument to Here's what I'm trying to do: move this "feature note" to the "done" section. |
Beta Was this translation helpful? Give feedback.
Hi, what about this (roughly)?