]> source.dussan.org Git - gitea.git/commitdiff
Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163)
authorGiteabot <teabot@gitea.io>
Thu, 21 Sep 2023 10:15:20 +0000 (18:15 +0800)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 10:15:20 +0000 (12:15 +0200)
Backport #27150 by @memphis88

Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).

Co-authored-by: Dionysios Kakouris <1369451+memphis88@users.noreply.github.com>
routers/api/v1/org/team.go

index 519572ee5188255947d25a84402a57b418591b19..83cbfe68d0ff833bbad0dc6e2e968f4b664466fd 100644 (file)
@@ -248,7 +248,7 @@ func CreateTeam(ctx *context.APIContext) {
                return
        }
 
-       apiTeam, err := convert.ToTeam(ctx, team)
+       apiTeam, err := convert.ToTeam(ctx, team, true)
        if err != nil {
                ctx.InternalServerError(err)
                return