refactored note creation methods into a separate service

This commit is contained in:
zadam
2020-02-03 20:07:34 +01:00
parent 822a8509b3
commit 66204811cf
9 changed files with 138 additions and 110 deletions

View File

@@ -3,6 +3,7 @@ import treeService from "../services/tree.js";
import treeCache from "../services/tree_cache.js";
import toastService from "../services/toast.js";
import appContext from "../services/app_context.js";
import noteCreateService from "../services/note_create.js";
const helpText = `
<strong>Search tips</strong> - also see <button class="btn btn-sm" type="button" data-help-page="Search">complete help on search</button>
@@ -128,7 +129,7 @@ export default class SearchBoxWidget extends BasicWidget {
activeNode = activeNode.getParent();
}
await treeService.createNote(activeNode, activeNode.data.noteId, 'into', {
await noteCreateService.createNote(activeNode.data.noteId, {
type: "search",
mime: "application/json",
title: searchString,