mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
moved all sources to src directory
This commit is contained in:
25
src/routes/api/recent_changes.js
Normal file
25
src/routes/api/recent_changes.js
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const sql = require('../../services/sql');
|
||||
const auth = require('../../services/auth');
|
||||
const wrap = require('express-promise-wrap').wrap;
|
||||
|
||||
router.get('/', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
const recentChanges = await sql.getAll(
|
||||
`SELECT
|
||||
notes.isDeleted AS current_isDeleted,
|
||||
notes.title AS current_title,
|
||||
note_revisions.*
|
||||
FROM
|
||||
note_revisions
|
||||
JOIN notes USING(noteId)
|
||||
ORDER BY
|
||||
dateModifiedTo DESC
|
||||
LIMIT 1000`);
|
||||
|
||||
res.send(recentChanges);
|
||||
}));
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user