Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 5619ee5

Browse files
ngourdonlafriks
authored andcommitted
add AdminListOrgs to list all orgs (#174)
1 parent ac88dcd commit 5619ee5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gitea/admin_org.go

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2015 The Gogs Authors. All rights reserved.
2+
// Copyright 2019 The Gitea Authors. All rights reserved.
23
// Use of this source code is governed by a MIT-style
34
// license that can be found in the LICENSE file.
45

@@ -12,6 +13,12 @@ import (
1213
"code.gitea.io/gitea/modules/structs"
1314
)
1415

16+
// AdminListOrgs lists all orgs
17+
func (c *Client) AdminListOrgs() ([]*Organization, error) {
18+
orgs := make([]*Organization, 0, 10)
19+
return orgs, c.getParsedResponse("GET", "/admin/orgs", nil, nil, &orgs)
20+
}
21+
1522
// AdminCreateOrg create an organization
1623
func (c *Client) AdminCreateOrg(user string, opt structs.CreateOrgOption) (*Organization, error) {
1724
body, err := json.Marshal(&opt)

0 commit comments

Comments
 (0)