mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
change in naming of SQL methods
added assert methods to note tree
This commit is contained in:
@@ -8,13 +8,13 @@ const auth = require('../../services/auth');
|
||||
router.get('', auth.checkApiAuth, async (req, res, next) => {
|
||||
await deleteOld();
|
||||
|
||||
const result = await sql.getResults("SELECT * FROM event_log ORDER BY date_added DESC");
|
||||
const result = await sql.getAll("SELECT * FROM event_log ORDER BY date_added DESC");
|
||||
|
||||
res.send(result);
|
||||
});
|
||||
|
||||
async function deleteOld() {
|
||||
const cutoffId = await sql.getSingleValue("SELECT id FROM event_log ORDER BY id DESC LIMIT 1000, 1");
|
||||
const cutoffId = await sql.getFirstValue("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