aboutsummaryrefslogtreecommitdiffhomepage
path: root/middlewares/reqValidators/utils.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-01-31 11:23:52 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-01-31 11:23:52 +0100
commitc45f7f84001c2731909db04dd82e1c1f290386eb (patch)
treeb7e57420a1f65dfbbacc1a532bf489c9bea6125d /middlewares/reqValidators/utils.js
parentcda021079ff455cc0fd0eb95a5395fa808ab63d1 (diff)
downloadPeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.tar.gz
PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.tar.zst
PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.zip
Infile code reorganization
Diffstat (limited to 'middlewares/reqValidators/utils.js')
-rw-r--r--middlewares/reqValidators/utils.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/middlewares/reqValidators/utils.js b/middlewares/reqValidators/utils.js
index 5bc9f4f0b..c88f6df2e 100644
--- a/middlewares/reqValidators/utils.js
+++ b/middlewares/reqValidators/utils.js
@@ -2,11 +2,14 @@
2 'use strict' 2 'use strict'
3 3
4 var util = require('util') 4 var util = require('util')
5
5 var logger = require('../../helpers/logger') 6 var logger = require('../../helpers/logger')
6 7
7 var utils = {} 8 var reqValidatorsUtils = {
9 checkErrors: checkErrors
10 }
8 11
9 utils.checkErrors = function (req, res, next, status_code) { 12 function checkErrors (req, res, next, status_code) {
10 if (status_code === undefined) status_code = 400 13 if (status_code === undefined) status_code = 400
11 var errors = req.validationErrors() 14 var errors = req.validationErrors()
12 15
@@ -18,5 +21,7 @@
18 return next() 21 return next()
19 } 22 }
20 23
21 module.exports = utils 24 // ---------------------------------------------------------------------------
25
26 module.exports = reqValidatorsUtils
22})() 27})()