2018-01-14 07:02:41 +08:00
|
|
|
"use strict";
|
|
|
|
|
2018-04-04 10:15:28 +08:00
|
|
|
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;
|
|
|
|
|
2018-04-04 10:15:28 +08:00
|
|
|
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
|
|
|
|
2018-04-04 10:15:28 +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
|
|
|
|
};
|