fix recent notes issues

This commit is contained in:
azivner
2018-06-06 22:38:36 -04:00
parent aee60c444f
commit 0e69f0c079
4 changed files with 39 additions and 53 deletions

View File

@@ -1,12 +1,12 @@
"use strict";
const repository = require('../../services/repository');
const dateUtils = require('../../services/date_utils');
const optionService = require('../../services/options');
const RecentNote = require('../../entities/recent_note');
const noteCacheService = require('../../services/note_cache');
async function getRecentNotes() {
return await repository.getEntities(`
const recentNotes = await repository.getEntities(`
SELECT
recent_notes.*
FROM
@@ -18,6 +18,12 @@ async function getRecentNotes() {
ORDER BY
dateCreated DESC
LIMIT 200`);
for (const rn of recentNotes) {
rn.title = noteCacheService.getNoteTitleForPath(rn.notePath.split('/'));
}
return recentNotes;
}
async function addRecentNote(req) {