mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
proper syncing of note positions
This commit is contained in:
@@ -55,6 +55,15 @@ router.get('/options/:optName', auth.checkApiAuth, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/notes_reordering/:noteParentId', auth.checkApiAuth, async (req, res, next) => {
|
||||
const noteParentId = req.params.noteParentId;
|
||||
|
||||
res.send({
|
||||
note_pid: noteParentId,
|
||||
ordering: await sql.getMap("SELECT note_id, note_pos FROM notes_tree WHERE note_pid = ?", [noteParentId])
|
||||
});
|
||||
});
|
||||
|
||||
router.put('/notes', auth.checkApiAuth, async (req, res, next) => {
|
||||
await sync.updateNote(req.body.entity, req.body.links, req.body.sourceId);
|
||||
|
||||
@@ -73,6 +82,12 @@ router.put('/notes_history', auth.checkApiAuth, async (req, res, next) => {
|
||||
res.send({});
|
||||
});
|
||||
|
||||
router.put('/notes_reordering', auth.checkApiAuth, async (req, res, next) => {
|
||||
await sync.updateNoteReordering(req.body.entity, req.body.sourceId);
|
||||
|
||||
res.send({});
|
||||
});
|
||||
|
||||
router.put('/options', auth.checkApiAuth, async (req, res, next) => {
|
||||
await sync.updateOptions(req.body.entity, req.body.sourceId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user