2018-01-13 18:02:41 -05:00
|
|
|
"use strict";
|
|
|
|
|
2018-04-03 22:15:28 -04:00
|
|
|
const cloningService = require('../../services/cloning');
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2018-03-30 13:20:36 -04:00
|
|
|
async function cloneNoteToParent(req) {
|
2020-05-31 22:33:02 +02:00
|
|
|
const {noteId, parentBranchId} = req.params;
|
2019-10-26 21:14:06 +02:00
|
|
|
const {prefix} = req.body;
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2020-05-31 22:33:02 +02:00
|
|
|
return await cloningService.cloneNoteToParent(noteId, parentBranchId, prefix);
|
2018-03-30 13:20:36 -04:00
|
|
|
}
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2018-03-30 13:20:36 -04:00
|
|
|
async function cloneNoteAfter(req) {
|
2019-10-26 21:14:06 +02:00
|
|
|
const {noteId, afterBranchId} = req.params;
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2018-04-03 22:15:28 -04:00
|
|
|
return await cloningService.cloneNoteAfter(noteId, afterBranchId);
|
2018-03-30 13:20:36 -04:00
|
|
|
}
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2018-03-30 13:20:36 -04:00
|
|
|
module.exports = {
|
|
|
|
cloneNoteToParent,
|
|
|
|
cloneNoteAfter
|
2020-05-31 22:33:02 +02:00
|
|
|
};
|