mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
consistent checking of is_deleted, some small refactorings
This commit is contained in:
@@ -12,14 +12,20 @@ const notes = require('../../services/notes');
|
||||
const sync_table = require('../../services/sync_table');
|
||||
|
||||
router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
||||
const notes = await sql.getAll("SELECT "
|
||||
+ "notes_tree.*, "
|
||||
+ "notes.note_title, "
|
||||
+ "notes.is_protected "
|
||||
+ "FROM notes_tree "
|
||||
+ "JOIN notes ON notes.note_id = notes_tree.note_id "
|
||||
+ "WHERE notes.is_deleted = 0 AND notes_tree.is_deleted = 0 "
|
||||
+ "ORDER BY note_position");
|
||||
const notes = await sql.getAll(`
|
||||
SELECT
|
||||
notes_tree.*,
|
||||
notes.note_title,
|
||||
notes.is_protected
|
||||
FROM
|
||||
notes_tree
|
||||
JOIN
|
||||
notes ON notes.note_id = notes_tree.note_id
|
||||
WHERE
|
||||
notes.is_deleted = 0
|
||||
AND notes_tree.is_deleted = 0
|
||||
ORDER BY
|
||||
note_position`);
|
||||
|
||||
const dataKey = protected_session.getDataKey(req);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user