mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 09:15:50 +01:00
Merge branch 'm38'
# Conflicts: # docs/backend_api/Note.html # docs/frontend_api/NoteShort.html # src/services/import/enex.js
This commit is contained in:
@@ -31,7 +31,11 @@ async function addClipping(req) {
|
||||
let clippingNote = await findClippingNote(todayNote, pageUrl);
|
||||
|
||||
if (!clippingNote) {
|
||||
clippingNote = (await noteService.createNote(todayNote.noteId, title, '')).note;
|
||||
clippingNote = (await noteService.createNewNote({
|
||||
parentNoteId: todayNote.noteId,
|
||||
title: title,
|
||||
content: ''
|
||||
})).note;
|
||||
|
||||
await clippingNote.setLabel('clipType', 'clippings');
|
||||
await clippingNote.setLabel('pageUrl', pageUrl);
|
||||
@@ -51,7 +55,11 @@ async function createNote(req) {
|
||||
|
||||
const todayNote = await dateNoteService.getDateNote(dateUtils.localNowDate());
|
||||
|
||||
const {note} = await noteService.createNote(todayNote.noteId, title, content);
|
||||
const {note} = await noteService.createNewNote({
|
||||
parentNoteId: todayNote.noteId,
|
||||
title,
|
||||
content
|
||||
});
|
||||
|
||||
await note.setLabel('clipType', clipType);
|
||||
|
||||
|
||||
@@ -53,10 +53,12 @@ async function getChildren(req) {
|
||||
}
|
||||
|
||||
async function createNote(req) {
|
||||
const parentNoteId = req.params.parentNoteId;
|
||||
const newNote = req.body;
|
||||
const params = Object.assign({}, req.body); // clone
|
||||
params.parentNoteId = req.params.parentNoteId;
|
||||
|
||||
const { note, branch } = await noteService.createNewNote(parentNoteId, newNote, req);
|
||||
const { target, targetBranchId } = req.query;
|
||||
|
||||
const { note, branch } = await noteService.createNewNoteWithTarget(target, targetBranchId, params);
|
||||
|
||||
await treeService.setCssClassesToNotes([note]);
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ async function uploadImage(req) {
|
||||
async function saveNote(req) {
|
||||
const parentNote = await dateNoteService.getDateNote(req.headers['x-local-date']);
|
||||
|
||||
const {note, branch} = await noteService.createNewNote(parentNote.noteId, {
|
||||
const {note, branch} = await noteService.createNewNote({
|
||||
parentNoteId: parentNote.noteId,
|
||||
title: req.body.title,
|
||||
content: req.body.content,
|
||||
target: 'into',
|
||||
isProtected: false,
|
||||
type: 'text',
|
||||
mime: 'text/html'
|
||||
|
||||
Reference in New Issue
Block a user