execute note (ctrl+enter) now works for both frontend and backend scripts

This commit is contained in:
azivner
2018-03-05 23:19:46 -05:00
parent d26170762b
commit 6d0218cb36
2 changed files with 21 additions and 2 deletions

View File

@@ -16,6 +16,17 @@ router.post('/exec', auth.checkApiAuth, wrap(async (req, res, next) => {
});
}));
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);
res.send({
executionResult: ret
});
}));
router.get('/startup', auth.checkApiAuth, wrap(async (req, res, next) => {
const repository = new Repository(req);
const notes = await attributes.getNotesWithAttribute(repository, "run", "frontend_startup");