summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/response.js16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/response.js b/lib/response.js
index 934179fd..20612b68 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -9,7 +9,7 @@ var config = require('./config')
var logger = require('./logger')
var models = require('./models')
const noteUtil = require('./web/note/util')
-const noteActions = require('./web/note/actions')
+const noteController = require('./web/note/controller')
const errors = require('./errors')
// public
@@ -17,7 +17,6 @@ var response = {
showNote: showNote,
showPublishNote: showPublishNote,
showIndex: showIndex,
- postNote: postNote,
publishNoteActions: publishNoteActions,
githubActions: githubActions,
gitlabActions: gitlabActions
@@ -70,17 +69,6 @@ function responseCodiMD (res, note) {
})
}
-function postNote (req, res, next) {
- var body = ''
- if (req.body && req.body.length > config.documentMaxLength) {
- return errors.errorTooLong(res)
- } else if (req.body) {
- body = req.body
- }
- body = body.replace(/[\r]/g, '')
- return noteUtil.newNote(req, res, body)
-}
-
function showNote (req, res, next) {
noteUtil.findNote(req, res, function (note) {
// force to use note id
@@ -156,7 +144,7 @@ function publishNoteActions (req, res, next) {
var action = req.params.action
switch (action) {
case 'download':
- noteActions.actionDownload(req, res, note)
+ noteController.downloadMarkdown(req, res, note)
break
case 'edit':
res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)) + '?both')