mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
refactored all mentions of "history" to "revision"
This commit is contained in:
@@ -10,10 +10,10 @@ const wrap = require('express-promise-wrap').wrap;
|
||||
|
||||
router.get('/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
const noteId = req.params.noteId;
|
||||
const history = await sql.getRows("SELECT * FROM note_revisions WHERE noteId = ? order by dateModifiedTo desc", [noteId]);
|
||||
protected_session.decryptNoteHistoryRows(req, history);
|
||||
const revisions = await sql.getRows("SELECT * FROM note_revisions WHERE noteId = ? order by dateModifiedTo desc", [noteId]);
|
||||
protected_session.decryptNoteRevisions(req, revisions);
|
||||
|
||||
res.send(history);
|
||||
res.send(revisions);
|
||||
}));
|
||||
|
||||
router.put('', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
@@ -22,7 +22,7 @@ router.put('', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
await sql.doInTransaction(async () => {
|
||||
await sql.replace("note_revisions", req.body);
|
||||
|
||||
await sync_table.addNoteHistorySync(req.body.noteRevisionId, sourceId);
|
||||
await sync_table.addNoteRevisionSync(req.body.noteRevisionId, sourceId);
|
||||
});
|
||||
|
||||
res.send();
|
||||
@@ -8,7 +8,7 @@ const auth = require('../../services/auth');
|
||||
const wrap = require('express-promise-wrap').wrap;
|
||||
|
||||
// options allowed to be updated directly in settings dialog
|
||||
const ALLOWED_OPTIONS = ['protected_session_timeout', 'history_snapshot_time_interval'];
|
||||
const ALLOWED_OPTIONS = ['protected_session_timeout', 'note_revision_snapshot_time_interval'];
|
||||
|
||||
router.get('/all', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
const settings = await sql.getMap("SELECT name, value FROM options");
|
||||
|
||||
@@ -59,7 +59,7 @@ router.post('/force-note-sync/:noteId', auth.checkApiAuth, wrap(async (req, res,
|
||||
}
|
||||
|
||||
for (const noteRevisionId of await sql.getColumn("SELECT noteRevisionId FROM note_revisions WHERE noteId = ?", [noteId])) {
|
||||
await sync_table.addNoteHistorySync(noteRevisionId);
|
||||
await sync_table.addNoteRevisionsSync(noteRevisionId);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ router.put('/branches', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
}));
|
||||
|
||||
router.put('/note_revisions', auth.checkApiAuth, wrap(async (req, res, next) => {
|
||||
await syncUpdate.updateNoteHistory(req.body.entity, req.body.sourceId);
|
||||
await syncUpdate.updateNoteRevision(req.body.entity, req.body.sourceId);
|
||||
|
||||
res.send({});
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user