set search note title correctly during creation

This commit is contained in:
zadam
2021-02-25 20:02:49 +01:00
parent d0eaf623a8
commit 7572ee284b
5 changed files with 34 additions and 34 deletions

View File

@@ -59,7 +59,10 @@ function createSqlConsole() {
return note;
}
function createSearchNote() {
function createSearchNote(req) {
const params = req.body;
const searchString = params.searchString || "";
const today = dateUtils.localNowDate();
const searchHome =
@@ -68,12 +71,18 @@ function createSearchNote() {
const {note} = noteService.createNewNote({
parentNoteId: searchHome.noteId,
title: 'Search: ',
title: 'Search: ' + searchString,
content: "",
type: 'search',
mime: 'application/json'
});
note.setLabel('searchString', searchString);
if (params.ancestorNoteId) {
note.setRelation('ancestor', params.ancestorNoteId);
}
return note;
}