add AdminListOrgs to list all orgs (#174)
This commit is contained in:
Родитель
ac88dcdb23
Коммит
5619ee57ba
|
@ -1,4 +1,5 @@
|
|||
// Copyright 2015 The Gogs Authors. All rights reserved.
|
||||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -12,6 +13,12 @@ import (
|
|||
"code.gitea.io/gitea/modules/structs"
|
||||
)
|
||||
|
||||
// AdminListOrgs lists all orgs
|
||||
func (c *Client) AdminListOrgs() ([]*Organization, error) {
|
||||
orgs := make([]*Organization, 0, 10)
|
||||
return orgs, c.getParsedResponse("GET", "/admin/orgs", nil, nil, &orgs)
|
||||
}
|
||||
|
||||
// AdminCreateOrg create an organization
|
||||
func (c *Client) AdminCreateOrg(user string, opt structs.CreateOrgOption) (*Organization, error) {
|
||||
body, err := json.Marshal(&opt)
|
||||
|
|
Загрузка…
Ссылка в новой задаче