Encapsulate note store more

This commit is contained in:
Joscha 2025-02-08 18:16:35 +01:00
parent c2b4592bc9
commit 3628fa260b
3 changed files with 22 additions and 27 deletions

View file

@ -11,8 +11,10 @@ const repos = useReposStore();
const notes = useNotesStore();
const ui = useUiStore();
function mkNote(id: string, ...children: string[]): Note {
return notes.addNote({ id, text: id, children });
function mkNote(text: string, ...children: string[]): Note {
const note = notes.createNote(text);
children.forEach((it) => note.children.push(it));
return note;
}
function createSomeNotes() {