trilium/src/routes/api/cloning.js

23 lines
588 B
JavaScript
Raw Normal View History

2018-01-14 07:02:41 +08:00
"use strict";
const cloningService = require('../../services/cloning');
2018-01-14 07:02:41 +08:00
2018-03-31 01:20:36 +08:00
async function cloneNoteToParent(req) {
2018-04-02 08:33:10 +08:00
const noteId = req.params.noteId;
2018-01-14 07:02:41 +08:00
const parentNoteId = req.params.parentNoteId;
const prefix = req.body.prefix;
return await cloningService.cloneNoteToParent(noteId, parentNoteId, prefix);
2018-03-31 01:20:36 +08:00
}
2018-01-14 07:02:41 +08:00
2018-03-31 01:20:36 +08:00
async function cloneNoteAfter(req) {
2018-01-14 07:02:41 +08:00
const noteId = req.params.noteId;
2018-03-25 09:39:15 +08:00
const afterBranchId = req.params.afterBranchId;
2018-01-14 07:02:41 +08:00
return await cloningService.cloneNoteAfter(noteId, afterBranchId);
2018-03-31 01:20:36 +08:00
}
2018-01-14 07:02:41 +08:00
2018-03-31 01:20:36 +08:00
module.exports = {
cloneNoteToParent,
cloneNoteAfter
};