basic text preview implemented

This commit is contained in:
zadam
2020-04-06 22:08:54 +02:00
parent 5c0355718f
commit 3772d97dfa
7 changed files with 276 additions and 167 deletions

View File

@@ -6,6 +6,7 @@ const RecentNote = require('../entities/recent_note');
const ApiToken = require('../entities/api_token');
const Option = require('../entities/option');
const repository = require('../services/repository');
const cls = require('./cls');
const ENTITY_NAME_TO_ENTITY = {
"attributes": Attribute,
@@ -32,9 +33,13 @@ function createEntityFromRow(row) {
if (row.attributeId) {
entity = new Attribute(row);
cls.setEntityToCache('attributes', row.attributeId, entity);
}
else if (row.noteRevisionId) {
entity = new NoteRevision(row);
cls.setEntityToCache('note_revisions', row.noteRevisionId, entity);
}
else if (row.branchId && row.notePath) {
entity = new RecentNote(row);
@@ -44,9 +49,13 @@ function createEntityFromRow(row) {
}
else if (row.branchId) {
entity = new Branch(row);
cls.setEntityToCache('branches', row.branchId, entity);
}
else if (row.noteId) {
entity = new Note(row);
cls.setEntityToCache('notes', row.noteId, entity);
}
else if (row.name) {
entity = new Option(row);