mirror of
https://github.com/gogs/gogs.git
synced 2026-03-02 10:11:04 +01:00
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
23 lines
441 B
Go
23 lines
441 B
Go
package org
|
|
|
|
import (
|
|
api "github.com/gogs/go-gogs-client"
|
|
|
|
"gogs.io/gogs/internal/context"
|
|
"gogs.io/gogs/internal/route/api/v1/convert"
|
|
)
|
|
|
|
func ListTeams(c *context.APIContext) {
|
|
org := c.Org.Organization
|
|
if err := org.GetTeams(); err != nil {
|
|
c.Error(err, "get teams")
|
|
return
|
|
}
|
|
|
|
apiTeams := make([]*api.Team, len(org.Teams))
|
|
for i := range org.Teams {
|
|
apiTeams[i] = convert.ToTeam(org.Teams[i])
|
|
}
|
|
c.JSONSuccess(apiTeams)
|
|
}
|