smaller refactorings (mostly entitization)

This commit is contained in:
azivner
2018-04-01 11:05:09 -04:00
parent c9d73c6115
commit fad0ec757b
12 changed files with 69 additions and 56 deletions

View File

@@ -1,14 +1,10 @@
"use strict";
const sql = require('../../services/sql');
const protected_session = require('../../services/protected_session');
const repository = require('../../services/repository');
async function getNoteRevisions(req) {
const noteId = req.params.noteId;
const revisions = await sql.getRows("SELECT * FROM note_revisions WHERE noteId = ? order by dateModifiedTo desc", [noteId]);
protected_session.decryptNoteRevisions(revisions);
return revisions;
return await repository.getEntities("SELECT * FROM note_revisions WHERE noteId = ? order by dateModifiedTo desc", [noteId]);
}
module.exports = {