summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-18 07:58:04 +0200
committerGitHub <noreply@github.com>2020-09-18 13:58:04 +0800
commit869fd17b88ecca1dcf4a0fa925156715aa29a312 (patch)
tree08d1efc96b0083758b89359a38be474ef681f501 /routers/api/v1
parentd624e91c0c7b0997fa4aa497d46650b7ba3cc1d6 (diff)
downloadgitea-869fd17b88ecca1dcf4a0fa925156715aa29a312.tar.gz
gitea-869fd17b88ecca1dcf4a0fa925156715aa29a312.zip
Fix [API] CreateRepo missing information (#12848) (#12867)
* Fix [API] [Bug] CreateRepo missing information (#12848) * Fix [API] [Bug] CreateRepo missing information * add code comment Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * CI.restart() * CI.restart() Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/repo/repo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index e5055daa2b..8a2e3ed6a6 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -256,6 +256,12 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
return
}
+ // reload repo from db to get a real state after creation
+ repo, err = models.GetRepositoryByID(repo.ID)
+ if err != nil {
+ ctx.Error(http.StatusInternalServerError, "GetRepositoryByID", err)
+ }
+
ctx.JSON(http.StatusCreated, repo.APIFormat(models.AccessModeOwner))
}