aboutsummaryrefslogtreecommitdiffhomepage
path: root/middlewares/reqValidators/utils.js
diff options
context:
space:
mode:
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})()