mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
set search note title correctly during creation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user