Feature: limit up to 10 deployment logs

This commit is contained in:
2015-12-07 15:56:38 +00:00
parent fe4ac511fc
commit 5417e05426

View File

@@ -2,10 +2,10 @@ Deployments = new Mongo.Collection('deployments');
DeploymentService = { DeploymentService = {
list: function(id) { list: function(id) {
var deployments = Deployments.find(), var deployments = Deployments.find({}, {sort: {timestamp: -1}}),
altered = deployments.map(function(doc, index, cursor) { altered = deployments.map(function(doc, index, cursor) {
return _.extend(doc, {index: deployments.count() - index}); return _.extend(doc, {index: deployments.count() - index});
}); });
return altered; return altered.slice(0, 10);
} }
}; };