summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Mehren2019-10-27 15:26:50 +0100
committerDavid Mehren2019-10-27 15:26:50 +0100
commit25a540ebbc3805bc3225b84e91d683ef8fa9e3ed (patch)
tree0b38081678d7a9f2bcba19d006f64975b51fbb52 /lib
parent2bc4233ba80346e60ed4840714a9aa347ccdb361 (diff)
Inline renderPublish
Signed-off-by: David Mehren <dmehren1@gmail.com>
Diffstat (limited to '')
-rw-r--r--lib/web/note/controller.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/web/note/controller.js b/lib/web/note/controller.js
index 991b891d..1395825f 100644
--- a/lib/web/note/controller.js
+++ b/lib/web/note/controller.js
@@ -44,7 +44,10 @@ exports.showPublishNote = function (req, res, next) {
return errors.errorNotFound(res)
}
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) {
logger.error(err)
@@ -53,13 +56,6 @@ exports.showPublishNote = function (req, res, next) {
}, 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) {
noteUtil.findNote(req, res, function (note) {
// force to use note id