From e7327afbae407db52b5deb72f4fd992848acd969 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Fri, 14 Jul 2023 20:01:23 +0200 Subject: [PATCH] fix: don't create notes if not found in presentation route Signed-off-by: Tilman Vatteroth --- lib/web/note/controller.js | 4 ++-- lib/web/note/util.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/web/note/controller.js b/lib/web/note/controller.js index af750793..9b943c57 100644 --- a/lib/web/note/controller.js +++ b/lib/web/note/controller.js @@ -78,7 +78,7 @@ exports.showNote = function (req, res, next) { title, opengraph }) - }) + }, null, true) } exports.createFromPOST = function (req, res, next) { @@ -119,7 +119,7 @@ exports.doAction = function (req, res, next) { default: return res.redirect(config.serverURL + '/' + noteId) } - }, null, false) + }) } exports.downloadMarkdown = function (req, res, note) { diff --git a/lib/web/note/util.js b/lib/web/note/util.js index 6842eebc..73215228 100644 --- a/lib/web/note/util.js +++ b/lib/web/note/util.js @@ -5,7 +5,7 @@ const errors = require('../../errors') const fs = require('fs') const path = require('path') -exports.findNote = function (req, res, callback, include, createIfNotFound = true) { +exports.findNote = function (req, res, callback, include = null, createIfNotFound = false) { const id = req.params.noteId || req.params.shortid models.Note.parseNoteId(id, function (err, _id) { if (err) {