trilium/node/routes/api/note_history.js
2017-10-15 17:09:41 -04:00

14 lines
431 B
JavaScript

const express = require('express');
const router = express.Router();
const sql = require('../../sql');
const auth = require('../../auth');
router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => {
const noteId = req.params.noteId;
const history = await sql.getResults("select * from notes_history where note_id = ? order by date_modified desc", [noteId]);
res.send(history);
});
module.exports = router;