usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject usergrid git commit: add count to paged organizations get, and fix limit=1000
Date Mon, 12 Sep 2016 23:54:36 GMT
Repository: usergrid
Updated Branches:
  refs/heads/hotfix-20160819 079898f45 -> 09c810372


add count to paged organizations get, and fix limit=1000


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/09c81037
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/09c81037
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/09c81037

Branch: refs/heads/hotfix-20160819
Commit: 09c810372ec049c545c39a437f0a1b1eae8a5a8a
Parents: 079898f
Author: Mike Dunker <mdunker@apigee.com>
Authored: Mon Sep 12 16:54:24 2016 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Mon Sep 12 16:54:24 2016 -0700

----------------------------------------------------------------------
 .../rest/management/organizations/OrganizationsResource.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/09c81037/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
index 84320b0..7d88f46 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
@@ -85,7 +85,11 @@ public class OrganizationsResource extends AbstractContextResource {
                 // do nothing let it be default
             }
         }
-        limit = limit < 1000 ? limit : 10;
+        if (limit < 1) {
+            limit = 1;
+        } else if (limit > 1000) {
+            limit = 1000;
+        }
 
 
 
@@ -120,6 +124,7 @@ public class OrganizationsResource extends AbstractContextResource {
         }
 
         response.setProperty("organizations", jsonOrgList);
+        response.setCount(orgs.size());
         response.setCursor(results.getCursor());
 
         return response;


Mime
View raw message