Skip to content

Commit

Permalink
Fix organization field being null in GET /api/v1/teams/{id} (#2…
Browse files Browse the repository at this point in the history
…4694) (#24696)

Backport #24694 by @yardenshoham

Enabled the organization loading flag.

- Fixes #20399 

# Before
```json
{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

# After
```json
{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
  • Loading branch information
GiteaBot and yardenshoham committed May 13, 2023
1 parent aa984f2 commit da1c38d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/org/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func GetTeam(ctx *context.APIContext) {
// "200":
// "$ref": "#/responses/Team"

apiTeam, err := convert.ToTeam(ctx, ctx.Org.Team)
apiTeam, err := convert.ToTeam(ctx, ctx.Org.Team, true)
if err != nil {
ctx.InternalServerError(err)
return
Expand Down

0 comments on commit da1c38d

Please sign in to comment.