mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
first experiments with code mirror
This commit is contained in:
@@ -10,6 +10,7 @@ const utils = require('../../services/utils');
|
||||
const protected_session = require('../../services/protected_session');
|
||||
const data_encryption = require('../../services/data_encryption');
|
||||
const tree = require('../../services/tree');
|
||||
const sync_table = require('../../services/sync_table');
|
||||
const wrap = require('express-promise-wrap').wrap;
|
||||
|
||||
router.get('/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
@@ -92,4 +93,19 @@ router.put('/:noteId/protect-sub-tree/:isProtected', auth.checkApiAuth, wrap(asy
|
||||
res.send({});
|
||||
}));
|
||||
|
||||
router.put('/:noteId/type/:type', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
const noteId = req.params.noteId;
|
||||
const type = req.params.type;
|
||||
const sourceId = req.headers.source_id;
|
||||
|
||||
await sql.doInTransaction(async () => {
|
||||
await sql.execute("UPDATE notes SET type = ?, date_modified = ? WHERE note_id = ?",
|
||||
[type, utils.nowDate(), noteId]);
|
||||
|
||||
await sync_table.addNoteSync(noteId, sourceId);
|
||||
});
|
||||
|
||||
res.send({});
|
||||
}));
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user