2018-01-13 18:02:41 -05:00
|
|
|
"use strict";
|
|
|
|
|
2023-11-22 19:34:48 +01:00
|
|
|
const cloningService = require('../../services/cloning.js');
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2021-12-27 23:39:46 +01:00
|
|
|
function cloneNoteToBranch(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
|
|
|
|
2021-12-27 23:39:46 +01:00
|
|
|
return cloningService.cloneNoteToBranch(noteId, parentBranchId, prefix);
|
|
|
|
}
|
|
|
|
|
2023-04-15 00:06:13 +02:00
|
|
|
function cloneNoteToParentNote(req) {
|
2021-12-27 23:39:46 +01:00
|
|
|
const {noteId, parentNoteId} = req.params;
|
|
|
|
const {prefix} = req.body;
|
|
|
|
|
2023-04-15 00:06:13 +02:00
|
|
|
return cloningService.cloneNoteToParentNote(noteId, parentNoteId, prefix);
|
2018-03-30 13:20:36 -04:00
|
|
|
}
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2020-06-20 12:31:38 +02:00
|
|
|
function cloneNoteAfter(req) {
|
2019-10-26 21:14:06 +02:00
|
|
|
const {noteId, afterBranchId} = req.params;
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2020-06-20 12:31:38 +02:00
|
|
|
return cloningService.cloneNoteAfter(noteId, afterBranchId);
|
2018-03-30 13:20:36 -04:00
|
|
|
}
|
2018-01-13 18:02:41 -05:00
|
|
|
|
2022-12-04 13:16:05 +01:00
|
|
|
function toggleNoteInParent(req) {
|
|
|
|
const {noteId, parentNoteId, present} = req.params;
|
|
|
|
|
|
|
|
return cloningService.toggleNoteInParent(present === 'true', noteId, parentNoteId);
|
|
|
|
}
|
|
|
|
|
2018-03-30 13:20:36 -04:00
|
|
|
module.exports = {
|
2021-12-27 23:39:46 +01:00
|
|
|
cloneNoteToBranch,
|
2023-04-15 00:06:13 +02:00
|
|
|
cloneNoteToParentNote,
|
2022-12-04 13:16:05 +01:00
|
|
|
cloneNoteAfter,
|
|
|
|
toggleNoteInParent
|
2020-05-31 22:33:02 +02:00
|
|
|
};
|