]> source.dussan.org Git - gitea.git/commitdiff
Return updated repository when changing repository using API (#16420)
author6543 <6543@obermui.de>
Tue, 13 Jul 2021 19:31:59 +0000 (21:31 +0200)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 19:31:59 +0000 (20:31 +0100)
routers/api/v1/repo/repo.go

index 77691b4d1561b15ffb750263a72e762db45e0277..b671ef2435ae033f717a050907ef43e061f894bd 100644 (file)
@@ -620,7 +620,13 @@ func Edit(ctx *context.APIContext) {
                }
        }
 
-       ctx.JSON(http.StatusOK, convert.ToRepo(ctx.Repo.Repository, ctx.Repo.AccessMode))
+       repo, err := models.GetRepositoryByID(ctx.Repo.Repository.ID)
+       if err != nil {
+               ctx.InternalServerError(err)
+               return
+       }
+
+       ctx.JSON(http.StatusOK, convert.ToRepo(repo, ctx.Repo.AccessMode))
 }
 
 // updateBasicProperties updates the basic properties of a repo: Name, Description, Website and Visibility