mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
renaming of sql methods to fit getRows/getEntities model
This commit is contained in:
@@ -9,13 +9,13 @@ const wrap = require('express-promise-wrap').wrap;
|
||||
router.get('', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
await deleteOld();
|
||||
|
||||
const result = await sql.getAll("SELECT * FROM event_log ORDER BY dateAdded DESC");
|
||||
const result = await sql.getRows("SELECT * FROM event_log ORDER BY dateAdded DESC");
|
||||
|
||||
res.send(result);
|
||||
}));
|
||||
|
||||
async function deleteOld() {
|
||||
const cutoffId = await sql.getFirstValue("SELECT id FROM event_log ORDER BY id DESC LIMIT 1000, 1");
|
||||
const cutoffId = await sql.getValue("SELECT id FROM event_log ORDER BY id DESC LIMIT 1000, 1");
|
||||
|
||||
if (cutoffId) {
|
||||
await sql.doInTransaction(async () => {
|
||||
|
||||
Reference in New Issue
Block a user