trilium/routes/api/note_history.js

16 lines
464 B
JavaScript
Raw Normal View History

2017-10-22 09:10:33 +08:00
"use strict";
const express = require('express');
const router = express.Router();
2017-10-16 07:47:05 +08:00
const sql = require('../../services/sql');
const auth = require('../../services/auth');
2017-10-16 04:32:49 +08:00
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;