From da1c38dd477afc555fd428441c6582b8ea1468e2 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 13 May 2023 15:01:54 -0400 Subject: [PATCH] Fix `organization` field being `null` in `GET /api/v1/teams/{id}` (#24694) (#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 Co-authored-by: Yarden Shoham --- routers/api/v1/org/team.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 0c6926759a76..98846cddc225 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -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