moved services into the service directory

This commit is contained in:
azivner
2018-03-25 13:02:39 -04:00
parent f52d7e3c28
commit fddd1c278f
33 changed files with 91 additions and 92 deletions

View File

@@ -0,0 +1,33 @@
"use strict";
import treeService from './tree_service.js';
async function cloneNoteTo(childNoteId, parentNoteId, prefix) {
const resp = await server.put('notes/' + childNoteId + '/clone-to/' + parentNoteId, {
prefix: prefix
});
if (!resp.success) {
alert(resp.message);
return;
}
await treeService.reload();
}
// beware that first arg is noteId and second is branchId!
async function cloneNoteAfter(noteId, afterBranchId) {
const resp = await server.put('notes/' + noteId + '/clone-after/' + afterBranchId);
if (!resp.success) {
alert(resp.message);
return;
}
await treeService.reload();
}
export default {
cloneNoteAfter,
cloneNoteTo
};