summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mehren2019-10-27 14:19:46 +0100
committerDavid Mehren2019-10-27 14:19:46 +0100
commit9d938c334a5a058e243327c65e15fd6fc56c9403 (patch)
tree873e4e930034155582c72250fe65208bf22ba588
parentf78540c3fbf109d6ccf2d92c5b1cf0148c88f722 (diff)
Fix errors constant in note/actions.js
Signed-off-by: David Mehren <dmehren1@gmail.com>
Diffstat (limited to '')
-rw-r--r--lib/web/note/actions.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/web/note/actions.js b/lib/web/note/actions.js
index cfefc8d5..a124277a 100644
--- a/lib/web/note/actions.js
+++ b/lib/web/note/actions.js
@@ -3,7 +3,7 @@
const models = require('../../models')
const logger = require('../../logger')
const config = require('../../config')
-const error = require('../../errors')
+const errors = require('../../errors')
const fs = require('fs')
const shortId = require('shortid')
const markdownpdf = require('markdown-pdf')
@@ -34,7 +34,7 @@ exports.doAction = function (req, res, next) {
actionPDF(req, res, note)
} else {
logger.error('PDF export failed: Disabled by config. Set "allowPDFExport: true" to enable. Check the documentation for details')
- error.errorForbidden(res)
+ errors.errorForbidden(res)
}
break
case 'gist':
@@ -113,7 +113,7 @@ function actionPDF (req, res, note) {
markdownpdf().from.string(content).to(path, function () {
if (!fs.existsSync(path)) {
logger.error('PDF seems to not be generated as expected. File doesn\'t exist: ' + path)
- return error.errorInternalError(res)
+ return errors.errorInternalError(res)
}
const stream = fs.createReadStream(path)
let filename = title
@@ -148,10 +148,10 @@ function actionRevision (req, res, note) {
models.Revision.getPatchedNoteRevisionByTime(note, time, function (err, content) {
if (err) {
logger.error(err)
- return error.errorInternalError(res)
+ return errors.errorInternalError(res)
}
if (!content) {
- return error.errorNotFound(res)
+ return errors.errorNotFound(res)
}
res.set({
'Access-Control-Allow-Origin': '*', // allow CORS as API
@@ -163,13 +163,13 @@ function actionRevision (req, res, note) {
res.send(content)
})
} else {
- return error.errorNotFound(res)
+ return errors.errorNotFound(res)
}
} else {
models.Revision.getNoteRevisions(note, function (err, data) {
if (err) {
logger.error(err)
- return error.errorInternalError(res)
+ return errors.errorInternalError(res)
}
const out = {
revision: data