changes in access to startNote and currentNote

This commit is contained in:
azivner
2018-03-06 23:04:35 -05:00
parent 6d0218cb36
commit 766a567a32
8 changed files with 74 additions and 42 deletions

View File

@@ -9,7 +9,7 @@ const script = require('../../services/script');
const Repository = require('../../services/repository');
router.post('/exec', auth.checkApiAuth, wrap(async (req, res, next) => {
const ret = await script.executeScript(req, req.body.script, req.body.params, req.body.startNoteId);
const ret = await script.executeScript(req, req.body.script, req.body.params, req.body.startNoteId, req.body.currentNoteId);
res.send({
executionResult: ret
@@ -20,7 +20,7 @@ router.post('/run/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
const repository = new Repository(req);
const note = await repository.getNote(req.params.noteId);
const ret = await script.executeNote(note);
const ret = await script.executeNote(req, note);
res.send({
executionResult: ret
@@ -42,7 +42,7 @@ router.get('/startup', auth.checkApiAuth, wrap(async (req, res, next) => {
res.send(scripts);
}));
router.get('/subtree/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
router.get('/bundle/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
const repository = new Repository(req);
const note = await repository.getNote(req.params.noteId);
const bundle = await script.getScriptBundle(note);