fixes to recent changes

This commit is contained in:
azivner
2017-12-03 17:46:56 -05:00
parent 34f1eb930c
commit 3a26054619
3 changed files with 52 additions and 19 deletions

View File

@@ -6,7 +6,17 @@ const sql = require('../../services/sql');
const auth = require('../../services/auth');
router.get('/', auth.checkApiAuth, async (req, res, next) => {
const recentChanges = await sql.getResults("SELECT * FROM notes_history order by date_modified_to desc limit 1000");
const recentChanges = await sql.getResults(
`SELECT
notes.is_deleted AS current_is_deleted,
notes.note_title AS current_note_title,
notes_history.*
FROM
notes_history
JOIN notes USING(note_id)
ORDER BY
date_modified_to DESC
LIMIT 1000`);
res.send(recentChanges);
});