mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
fix: don't create notes if not found in presentation route
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
bf53443c67
commit
e7327afbae
2 changed files with 3 additions and 3 deletions
|
@ -78,7 +78,7 @@ exports.showNote = function (req, res, next) {
|
||||||
title,
|
title,
|
||||||
opengraph
|
opengraph
|
||||||
})
|
})
|
||||||
})
|
}, null, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.createFromPOST = function (req, res, next) {
|
exports.createFromPOST = function (req, res, next) {
|
||||||
|
@ -119,7 +119,7 @@ exports.doAction = function (req, res, next) {
|
||||||
default:
|
default:
|
||||||
return res.redirect(config.serverURL + '/' + noteId)
|
return res.redirect(config.serverURL + '/' + noteId)
|
||||||
}
|
}
|
||||||
}, null, false)
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.downloadMarkdown = function (req, res, note) {
|
exports.downloadMarkdown = function (req, res, note) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ const errors = require('../../errors')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
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
|
const id = req.params.noteId || req.params.shortid
|
||||||
models.Note.parseNoteId(id, function (err, _id) {
|
models.Note.parseNoteId(id, function (err, _id) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue