|
|
|
@ -34,6 +34,32 @@ module.exports = {
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
jarvisid: function(req, res) { |
|
|
|
|
var word = req.param('query'), |
|
|
|
|
_options = {}, |
|
|
|
|
_count, query; |
|
|
|
|
|
|
|
|
|
if (word != undefined) { |
|
|
|
|
_options['jarvisId'] = word; |
|
|
|
|
} |
|
|
|
|
_options['sort'] = {date: -1}; |
|
|
|
|
|
|
|
|
|
query = UserActivity.find(_options); |
|
|
|
|
page = ((req.query.page != undefined) ? +req.query.page : 1); |
|
|
|
|
UserActivity.count(_options).exec(function(err, total) { |
|
|
|
|
if (err) |
|
|
|
|
res.send(400); |
|
|
|
|
|
|
|
|
|
query.paginate({page: page, limit: 10}).populate('revision').exec(function(err, items) { |
|
|
|
|
if (err) { |
|
|
|
|
res.send(400); |
|
|
|
|
} else { |
|
|
|
|
res.send({count: total, results: items}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
oneteam: function(req, res) { |
|
|
|
|
var teamQ = req.param('team'), |
|
|
|
|
_options = {}, |
|
|
|
@ -49,7 +75,7 @@ module.exports = {
|
|
|
|
|
if (err) |
|
|
|
|
res.send(400); |
|
|
|
|
|
|
|
|
|
query.paginate({page: page, limit: 10}).populate('jarvisId').exec(function(err, items) { |
|
|
|
|
query.paginate({page: page, limit: 10}).populate('revision').exec(function(err, items) { |
|
|
|
|
if (err) { |
|
|
|
|
res.send(400); |
|
|
|
|
} else { |
|
|
|
@ -76,7 +102,7 @@ module.exports = {
|
|
|
|
|
if (err) |
|
|
|
|
res.send(400); |
|
|
|
|
|
|
|
|
|
query.paginate({page: page, limit: 10}).populate('jarvisId').exec(function(err, items) { |
|
|
|
|
query.paginate({page: page, limit: 10}).populate('revision').exec(function(err, items) { |
|
|
|
|
if (err) { |
|
|
|
|
res.send(400); |
|
|
|
|
} else { |
|
|
|
|