mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
allow cloning into notes, not just branches, fixes #2484
This commit is contained in:
@@ -2,11 +2,18 @@
|
||||
|
||||
const cloningService = require('../../services/cloning');
|
||||
|
||||
function cloneNoteToParent(req) {
|
||||
function cloneNoteToBranch(req) {
|
||||
const {noteId, parentBranchId} = req.params;
|
||||
const {prefix} = req.body;
|
||||
|
||||
return cloningService.cloneNoteToParent(noteId, parentBranchId, prefix);
|
||||
return cloningService.cloneNoteToBranch(noteId, parentBranchId, prefix);
|
||||
}
|
||||
|
||||
function cloneNoteToNote(req) {
|
||||
const {noteId, parentNoteId} = req.params;
|
||||
const {prefix} = req.body;
|
||||
|
||||
return cloningService.cloneNoteToNote(noteId, parentNoteId, prefix);
|
||||
}
|
||||
|
||||
function cloneNoteAfter(req) {
|
||||
@@ -16,6 +23,7 @@ function cloneNoteAfter(req) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
cloneNoteToParent,
|
||||
cloneNoteToBranch,
|
||||
cloneNoteToNote,
|
||||
cloneNoteAfter
|
||||
};
|
||||
|
||||
@@ -229,7 +229,8 @@ function register(app) {
|
||||
|
||||
apiRoute(GET, '/api/edited-notes/:date', noteRevisionsApiRoute.getEditedNotesOnDate);
|
||||
|
||||
apiRoute(PUT, '/api/notes/:noteId/clone-to/:parentBranchId', cloningApiRoute.cloneNoteToParent);
|
||||
apiRoute(PUT, '/api/notes/:noteId/clone-to-branch/:parentBranchId', cloningApiRoute.cloneNoteToBranch);
|
||||
apiRoute(PUT, '/api/notes/:noteId/clone-to-note/:parentNoteId', cloningApiRoute.cloneNoteToNote);
|
||||
apiRoute(PUT, '/api/notes/:noteId/clone-after/:afterBranchId', cloningApiRoute.cloneNoteAfter);
|
||||
|
||||
route(GET, '/api/notes/:branchId/export/:type/:format/:version/:taskId', [auth.checkApiAuthOrElectron], exportRoute.exportBranch);
|
||||
|
||||
Reference in New Issue
Block a user