From 5619ee57baadbf01efa28e59207ef57bd6044fde Mon Sep 17 00:00:00 2001 From: ngourdon <31291059+ngourdon@users.noreply.github.com> Date: Sun, 2 Jun 2019 13:01:10 +0200 Subject: [PATCH] add AdminListOrgs to list all orgs (#174) --- gitea/admin_org.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gitea/admin_org.go b/gitea/admin_org.go index cc25889..1029d49 100644 --- a/gitea/admin_org.go +++ b/gitea/admin_org.go @@ -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)