1 2
var stats = require('../helper/stats.js');
3
module.exports = function (req,mandatoryList,api){
4
5
var err = [];
6 7
for(var i=0;i<mandatoryList.length;i++)
8
{
9 10 11
if(typeof req.query[mandatoryList[i]] === 'undefined') { var errDes = {
12
Param : mandatoryList[i],
13
Reason : "Missing"
14
}
15 16 17
err.push(errDes); }else {
18 19 20 21
// invaild } }
22
if(err.length > 0)
23 24 25
stats.reciveRequest(api,false); else stats.reciveRequest(api,true);
26
27 28 29
// console.log(err); return err;
30
};