mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
add #shareRoot label to define an "index" note, closes #2567
This commit is contained in:
@@ -21,13 +21,7 @@ function getSharedSubTreeRoot(note) {
|
||||
}
|
||||
|
||||
function register(router) {
|
||||
router.get('/share/:shareId', (req, res, next) => {
|
||||
const {shareId} = req.params;
|
||||
|
||||
shacaLoader.ensureLoad();
|
||||
|
||||
const note = shaca.aliasToNote[shareId] || shaca.notes[shareId];
|
||||
|
||||
function renderNote(note, res) {
|
||||
if (note) {
|
||||
const {header, content, isEmpty} = contentRenderer.getContent(note);
|
||||
|
||||
@@ -40,10 +34,25 @@ function register(router) {
|
||||
isEmpty,
|
||||
subRoot
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
res.status(404).render("share/404");
|
||||
}
|
||||
}
|
||||
|
||||
router.get(['/share', '/share/'], (req, res, next) => {
|
||||
shacaLoader.ensureLoad();
|
||||
|
||||
renderNote(shaca.shareRootNote, res);
|
||||
});
|
||||
|
||||
router.get('/share/:shareId', (req, res, next) => {
|
||||
const {shareId} = req.params;
|
||||
|
||||
shacaLoader.ensureLoad();
|
||||
|
||||
const note = shaca.aliasToNote[shareId] || shaca.notes[shareId];
|
||||
|
||||
renderNote(note, res);
|
||||
});
|
||||
|
||||
router.get('/share/api/notes/:noteId', (req, res, next) => {
|
||||
|
||||
Reference in New Issue
Block a user