Skip to content

Commit 869fd17

Browse files
6543lunnyzeripath
authored
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 <[email protected]> * CI.restart() * CI.restart() Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent d624e91 commit 869fd17

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

routers/api/v1/repo/repo.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
256256
return
257257
}
258258

259+
// reload repo from db to get a real state after creation
260+
repo, err = models.GetRepositoryByID(repo.ID)
261+
if err != nil {
262+
ctx.Error(http.StatusInternalServerError, "GetRepositoryByID", err)
263+
}
264+
259265
ctx.JSON(http.StatusCreated, repo.APIFormat(models.AccessModeOwner))
260266
}
261267

0 commit comments

Comments
 (0)