more changes for scripts - separate API etc.

This commit is contained in:
azivner
2018-01-27 17:18:19 -05:00
parent 005480059a
commit 3f1e73d06b
7 changed files with 202 additions and 71 deletions

View File

@@ -10,8 +10,10 @@ const protected_session = require('../../services/protected_session');
const attributes = require('../../services/attributes');
const script = require('../../services/script');
router.post('/exec', auth.checkApiAuth, wrap(async (req, res, next) => {
const ret = await script.executeScript(req, req.body.script, req.body.params);
router.post('/exec/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
const noteId = req.params.noteId;
const ret = await script.executeScript(noteId, req, req.body.script, req.body.params);
res.send(ret);
}));