mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Inline renderPublish
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
2bc4233ba8
commit
25a540ebbc
1 changed files with 4 additions and 8 deletions
|
@ -44,7 +44,10 @@ exports.showPublishNote = function (req, res, next) {
|
||||||
return errors.errorNotFound(res)
|
return errors.errorNotFound(res)
|
||||||
}
|
}
|
||||||
noteUtil.getPublishData(req, res, note, (data) => {
|
noteUtil.getPublishData(req, res, note, (data) => {
|
||||||
return renderPublish(data, res)
|
res.set({
|
||||||
|
'Cache-Control': 'private' // only cache by client
|
||||||
|
})
|
||||||
|
return res.render('pretty.ejs', data)
|
||||||
})
|
})
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
logger.error(err)
|
logger.error(err)
|
||||||
|
@ -53,13 +56,6 @@ exports.showPublishNote = function (req, res, next) {
|
||||||
}, include)
|
}, include)
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderPublish (data, res) {
|
|
||||||
res.set({
|
|
||||||
'Cache-Control': 'private' // only cache by client
|
|
||||||
})
|
|
||||||
res.render('pretty.ejs', data)
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.showNote = function (req, res, next) {
|
exports.showNote = function (req, res, next) {
|
||||||
noteUtil.findNote(req, res, function (note) {
|
noteUtil.findNote(req, res, function (note) {
|
||||||
// force to use note id
|
// force to use note id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue