Inline renderPublishSlide

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2019-10-27 15:44:23 +01:00
parent 3c39d07723
commit b5ccceff59
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -32,7 +32,10 @@ exports.showPublishSlide = function (req, res, next) {
return errors.errorNotFound(res)
}
noteUtil.getPublishData(req, res, note, (data) => {
return renderPublishSlide(data, res)
res.set({
'Cache-Control': 'private' // only cache by client
})
return res.render('slide.ejs', data)
})
}).catch(function (err) {
logger.error(err)
@ -40,10 +43,3 @@ exports.showPublishSlide = function (req, res, next) {
})
}, include)
}
function renderPublishSlide (data, res) {
res.set({
'Cache-Control': 'private' // only cache by client
})
res.render('slide.ejs', data)
}