From 56993c2387b952b75e41bd62583df547d61b5542 Mon Sep 17 00:00:00 2001 From: Muhammed Tareq Aziz Date: Wed, 5 Oct 2016 13:18:26 +0600 Subject: [PATCH] username added on query --- queryMaker.js | 4 ++-- server.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/queryMaker.js b/queryMaker.js index 6fa5b55..3700417 100644 --- a/queryMaker.js +++ b/queryMaker.js @@ -11,9 +11,9 @@ module.exports = { }; return dynObj; } else if ((params.query.usertype === "USER" || params.query.usertype === "ENTERPRISE") - && params.query.userid && params.query.userid.length === 24) { + && params.query.username) { return { - "User.UserId" : params.query.userid, + "User.UserName" : params.query.username, "CreateTime" : { $gte: new Date(params.query.startdate), $lt: new Date(params.query.enddate), diff --git a/server.js b/server.js index 0dca1cb..323372d 100644 --- a/server.js +++ b/server.js @@ -28,7 +28,7 @@ router.get('/', function(req, res){ // Parameters: // usertype = USER BIKE_MESSENGER ENTERPRISE -// userid = Asset's user id +// userid = Asset's user id or username = USER's or ENTERPRISE's UserName // startdate = ISOdate // enddate = ISOdate // generateexcel = boolean @@ -76,7 +76,7 @@ router.get('/report', function (req, res) { // Parameters: // usertype = USER BIKE_MESSENGER ENTERPRISE -// userid = Asset's user id +// userid = Asset's user id or username = USER's or ENTERPRISE's UserName // startdate = ISOdate // enddate = ISOdate // generateexcel = boolean