mirror of https://github.com/gogits/gogs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
614 B
27 lines
614 B
9 years ago
|
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package org
|
||
|
|
||
|
import (
|
||
|
api "github.com/gogits/go-gogs-client"
|
||
|
|
||
8 years ago
|
"github.com/gogits/gogs/pkg/context"
|
||
8 years ago
|
"github.com/gogits/gogs/routes/api/v1/convert"
|
||
9 years ago
|
)
|
||
|
|
||
8 years ago
|
func ListTeams(c *context.APIContext) {
|
||
|
org := c.Org.Organization
|
||
9 years ago
|
if err := org.GetTeams(); err != nil {
|
||
8 years ago
|
c.Error(500, "GetTeams", err)
|
||
9 years ago
|
return
|
||
|
}
|
||
|
|
||
|
apiTeams := make([]*api.Team, len(org.Teams))
|
||
|
for i := range org.Teams {
|
||
|
apiTeams[i] = convert.ToTeam(org.Teams[i])
|
||
|
}
|
||
8 years ago
|
c.JSON(200, apiTeams)
|
||
9 years ago
|
}
|