mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-02 19:36:12 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			645 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			645 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
"use strict";
 | 
						|
 | 
						|
const express = require('express');
 | 
						|
const router = express.Router();
 | 
						|
const sql = require('../../services/sql');
 | 
						|
const auth = require('../../services/auth');
 | 
						|
 | 
						|
router.get('/', auth.checkApiAuth, async (req, res, next) => {
 | 
						|
    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);
 | 
						|
});
 | 
						|
 | 
						|
module.exports = router; |