summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
authorDavid Mehren2019-10-27 14:40:36 +0100
committerDavid Mehren2019-10-27 14:40:36 +0100
commit30487f7c01dc15435d86d95d24257853d7930154 (patch)
treecc34d4b2b13f0502583fc953fc3a3dba49c9d30a /lib/response.js
parentafb317b55155eed2cfcad0fee5aba2107dc0b106 (diff)
Rename actions.js to controller.js and rename functions to be more descriptive
Move postNote to NoteController and rename to createFromPost Signed-off-by: David Mehren <dmehren1@gmail.com>
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')