From c98dad1cf3b068f6bbb52a9cd791f2bd180731f2 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Fri, 25 Sep 2015 19:54:52 +0200 Subject: New admin organization UI --- models/org.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'models') diff --git a/models/org.go b/models/org.go index b45dcafb..5c3b0d12 100644 --- a/models/org.go +++ b/models/org.go @@ -184,11 +184,10 @@ func CountOrganizations() int64 { return count } -// GetOrganizations returns given number of organizations with offset. -func GetOrganizations(num, offset int) ([]*User, error) { - orgs := make([]*User, 0, num) - err := x.Limit(num, offset).Where("type=1").Asc("id").Find(&orgs) - return orgs, err +// Organizations returns number of organizations in given page. +func Organizations(page, pageSize int) ([]*User, error) { + orgs := make([]*User, 0, pageSize) + return orgs, x.Limit(pageSize, (page-1)*pageSize).Where("type=1").Asc("id").Find(&orgs) } // DeleteOrganization completely and permanently deletes everything of organization. -- cgit v1.2.3