#129, removed recent notes dialog as its not necessary anymore

This commit is contained in:
azivner
2018-07-26 17:35:32 +02:00
parent f578e001b0
commit e4f459fa2b
8 changed files with 12 additions and 114 deletions

View File

@@ -1,30 +1,7 @@
"use strict";
const repository = require('../../services/repository');
const optionService = require('../../services/options');
const RecentNote = require('../../entities/recent_note');
const noteCacheService = require('../../services/note_cache');
async function getRecentNotes() {
const recentNotes = await repository.getEntities(`
SELECT
recent_notes.*
FROM
recent_notes
JOIN branches USING(branchId)
WHERE
recent_notes.isDeleted = 0
AND branches.isDeleted = 0
ORDER BY
dateCreated DESC
LIMIT 200`);
for (const rn of recentNotes) {
rn.title = noteCacheService.getNoteTitleForPath(rn.notePath.split('/'));
}
return recentNotes;
}
async function addRecentNote(req) {
const branchId = req.params.branchId;
@@ -36,11 +13,8 @@ async function addRecentNote(req) {
}).save();
await optionService.setOption('startNotePath', notePath);
return await getRecentNotes();
}
module.exports = {
getRecentNotes,
addRecentNote
};