refactor: change errorTooLong function signature to avoid parameter passing error

Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
BoHong Li 2020-02-26 11:23:55 +08:00
parent 35a2135b36
commit 8787177991
No known key found for this signature in database
GPG Key ID: 06770355DC9ECD38
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ function errorBadRequest (req, res) {
responseError(res, '400', 'Bad Request', 'something not right.')
}
function errorTooLong (res) {
function errorTooLong (req, res) {
responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
}
@ -91,7 +91,7 @@ function newNote (req, res, next) {
var owner = null
var body = ''
if (req.body && req.body.length > config.documentMaxLength) {
return errorTooLong(res)
return errorTooLong(req, res)
} else if (req.body) {
body = req.body
}