From 30487f7c01dc15435d86d95d24257853d7930154 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 27 Oct 2019 14:40:36 +0100 Subject: 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 --- lib/response.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lib/response.js') 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') -- cgit v1.2.3