Jelajahi Sumber

Feature: limit up to 10 deployment logs

febbweiss 10 tahun lalu
induk
melakukan
5417e05426
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      client/deployment.service.js

+ 2 - 2
client/deployment.service.js

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