mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
converted note revision protection to repository/entities
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const sql = require('../../services/sql');
|
||||
const auth = require('../../services/auth');
|
||||
const labels = require('../../services/labels');
|
||||
const notes = require('../../services/notes');
|
||||
const wrap = require('express-promise-wrap').wrap;
|
||||
const tar = require('tar-stream');
|
||||
const multer = require('multer')();
|
||||
const stream = require('stream');
|
||||
const path = require('path');
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const auth = require('../../services/auth');
|
||||
const sql = require('../../services/sql');
|
||||
const notes = require('../../services/notes');
|
||||
const utils = require('../../services/utils');
|
||||
const protected_session = require('../../services/protected_session');
|
||||
const tree = require('../../services/tree');
|
||||
const sync_table = require('../../services/sync_table');
|
||||
const wrap = require('express-promise-wrap').wrap;
|
||||
const repository = require('../../services/repository');
|
||||
|
||||
async function getNote(req) {
|
||||
const noteId = req.params.noteId;
|
||||
@@ -58,9 +55,10 @@ async function sortNotes(req) {
|
||||
|
||||
async function protectBranch(req) {
|
||||
const noteId = req.params.noteId;
|
||||
const isProtected = !!parseInt(req.params.isProtected);
|
||||
const note = repository.getNote(noteId);
|
||||
const protect = !!parseInt(req.params.isProtected);
|
||||
|
||||
await notes.protectNoteRecursively(noteId, isProtected);
|
||||
await notes.protectNoteRecursively(note, protect);
|
||||
}
|
||||
|
||||
async function setNoteTypeMime(req) {
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const image = require('../../services/image');
|
||||
const utils = require('../../services/utils');
|
||||
const date_notes = require('../../services/date_notes');
|
||||
const sql = require('../../services/sql');
|
||||
const wrap = require('express-promise-wrap').wrap;
|
||||
const notes = require('../../services/notes');
|
||||
const multer = require('multer')();
|
||||
const password_encryption = require('../../services/password_encryption');
|
||||
const options = require('../../services/options');
|
||||
const sync_table = require('../../services/sync_table');
|
||||
|
||||
Reference in New Issue
Block a user