repository is now stateless

This commit is contained in:
azivner
2018-03-31 09:07:58 -04:00
parent 05676f3459
commit 088fb00ca9
9 changed files with 87 additions and 98 deletions

View File

@@ -2,22 +2,20 @@
const source_id = require('../services/source_id');
const sql = require('../services/sql');
const Repository = require('../services/repository');
const repository = require('../services/repository');
const labels = require('../services/labels');
async function index(req, res) {
const repository = new Repository(req);
res.render('index', {
sourceId: await source_id.generateSourceId(),
maxSyncIdAtLoad: await sql.getValue("SELECT MAX(id) FROM sync"),
appCss: await getAppCss(repository)
appCss: await getAppCss()
});
}
async function getAppCss(repository) {
async function getAppCss() {
let css = '';
const notes = labels.getNotesWithLabel(repository, 'app_css');
const notes = labels.getNotesWithLabel('app_css');
for (const note of await notes) {
css += `/* ${note.noteId} */