2017-10-21 21:10:33 -04:00
|
|
|
"use strict";
|
|
|
|
|
2017-10-15 19:47:05 -04:00
|
|
|
const sql = require('../../services/sql');
|
2017-11-14 22:21:56 -05:00
|
|
|
const protected_session = require('../../services/protected_session');
|
2017-10-14 23:31:44 -04:00
|
|
|
|
2018-03-30 13:56:46 -04:00
|
|
|
async function getNoteRevisions(req) {
|
2017-10-14 23:31:44 -04:00
|
|
|
const noteId = req.params.noteId;
|
2018-03-25 20:52:38 -04:00
|
|
|
const revisions = await sql.getRows("SELECT * FROM note_revisions WHERE noteId = ? order by dateModifiedTo desc", [noteId]);
|
2018-03-31 08:53:52 -04:00
|
|
|
protected_session.decryptNoteRevisions(revisions);
|
2017-10-14 23:31:44 -04:00
|
|
|
|
2018-03-30 13:56:46 -04:00
|
|
|
return revisions;
|
|
|
|
}
|
2017-10-14 23:31:44 -04:00
|
|
|
|
2018-03-30 13:56:46 -04:00
|
|
|
module.exports = {
|
|
|
|
getNoteRevisions
|
|
|
|
};
|