mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
refactored backend to use new naming convention for modules
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
const labels = require('../../services/labels');
|
||||
const script = require('../../services/script');
|
||||
const labelService = require('../../services/labels');
|
||||
const scriptService = require('../../services/script');
|
||||
const repository = require('../../services/repository');
|
||||
|
||||
async function exec(req) {
|
||||
const result = await script.executeScript(req.body.script, req.body.params, req.body.startNoteId, req.body.currentNoteId);
|
||||
const result = await scriptService.executeScript(req.body.script, req.body.params, req.body.startNoteId, req.body.currentNoteId);
|
||||
|
||||
return { executionResult: result };
|
||||
}
|
||||
@@ -13,18 +13,18 @@ async function exec(req) {
|
||||
async function run(req) {
|
||||
const note = await repository.getNote(req.params.noteId);
|
||||
|
||||
const result = await script.executeNote(req, note);
|
||||
const result = await scriptService.executeNote(req, note);
|
||||
|
||||
return { executionResult: result };
|
||||
}
|
||||
|
||||
async function getStartupBundles(req) {
|
||||
const notes = await labels.getNotesWithLabel("run", "frontend_startup");
|
||||
const notes = await labelService.getNotesWithLabel("run", "frontend_startup");
|
||||
|
||||
const bundles = [];
|
||||
|
||||
for (const note of notes) {
|
||||
const bundle = await script.getScriptBundle(note);
|
||||
const bundle = await scriptService.getScriptBundle(note);
|
||||
|
||||
if (bundle) {
|
||||
bundles.push(bundle);
|
||||
@@ -36,7 +36,7 @@ async function getStartupBundles(req) {
|
||||
|
||||
async function getBundle(req) {
|
||||
const note = await repository.getNote(req.params.noteId);
|
||||
return await script.getScriptBundle(note);
|
||||
return await scriptService.getScriptBundle(note);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user