yet another refactoring of working with note's payload/content

This commit is contained in:
zadam
2019-03-26 22:24:04 +01:00
parent 4bdcf32475
commit 29c60581a6
31 changed files with 126 additions and 239 deletions

View File

@@ -58,10 +58,10 @@ async function executeBundle(bundle, apiParams = {}) {
*/
async function executeScript(script, params, startNoteId, currentNoteId, originEntityName, originEntityId) {
const startNote = await repository.getNote(startNoteId);
const currentNote = await repository.getNoteWithContent(currentNoteId);
const currentNote = await repository.getNote(currentNoteId);
const originEntity = await repository.getEntityFromName(originEntityName, originEntityId);
currentNote.noteContent.content = `return await (${script}\r\n)(${getParams(params)})`;
currentNote.content = `return await (${script}\r\n)(${getParams(params)})`;
currentNote.type = 'code';
currentNote.mime = 'application/javascript;env=backend';