Merge branch 'm38'

# Conflicts:
#	docs/backend_api/Note.html
#	docs/frontend_api/NoteShort.html
#	src/services/import/enex.js
This commit is contained in:
zadam
2019-11-18 23:26:29 +01:00
55 changed files with 4304 additions and 874 deletions

View File

@@ -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);

View File

@@ -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]);

View File

@@ -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'