mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
backend ported to node.js (work in progress)
This commit is contained in:
18
node/routes/audit.js
Normal file
18
node/routes/audit.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const sql = require('../sql');
|
||||
|
||||
router.get('/:full_load_time', async (req, res, next) => {
|
||||
const fullLoadTime = req.params.full_load_time;
|
||||
|
||||
const browserId = req.get('x-browser-id');
|
||||
|
||||
const count = await sql.getSingleResult("SELECT COUNT(*) AS 'count' FROM audit_log WHERE browser_id != ? " +
|
||||
"AND date_modified >= ?", [browserId, fullLoadTime])['count'];
|
||||
|
||||
res.send({
|
||||
'changed': count > 0
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user