mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
Move note actions into their own file
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
30487f7c01
commit
181d5646cf
2 changed files with 131 additions and 9 deletions
lib/web/note
|
@ -4,12 +4,11 @@ const models = require('../../models')
|
|||
const logger = require('../../logger')
|
||||
const config = require('../../config')
|
||||
const errors = require('../../errors')
|
||||
const fs = require('fs')
|
||||
const shortId = require('shortid')
|
||||
const markdownpdf = require('markdown-pdf')
|
||||
const moment = require('moment')
|
||||
const querystring = require('querystring')
|
||||
|
||||
const noteUtil = require('./util')
|
||||
const noteActions = require('./actions')
|
||||
|
||||
|
||||
|
||||
exports.createFromPOST = function (req, res, next) {
|
||||
let body = ''
|
||||
|
@ -38,21 +37,21 @@ exports.doAction = function (req, res, next) {
|
|||
exports.downloadMarkdown(req, res, note)
|
||||
break
|
||||
case 'info':
|
||||
getInfo(req, res, note)
|
||||
noteActions.getInfo(req, res, note)
|
||||
break
|
||||
case 'pdf':
|
||||
if (config.allowPDFExport) {
|
||||
createPDF(req, res, note)
|
||||
noteActions.createPDF(req, res, note)
|
||||
} else {
|
||||
logger.error('PDF export failed: Disabled by config. Set "allowPDFExport: true" to enable. Check the documentation for details')
|
||||
errors.errorForbidden(res)
|
||||
}
|
||||
break
|
||||
case 'gist':
|
||||
createGist(req, res, note)
|
||||
noteActions.createGist(req, res, note)
|
||||
break
|
||||
case 'revision':
|
||||
getRevision(req, res, note)
|
||||
noteActions.getRevision(req, res, note)
|
||||
break
|
||||
default:
|
||||
return res.redirect(config.serverURL + '/' + noteId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue