mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-22 13:03:55 +01:00
Fix [API] [Bug] CreateRepo missing information (#12848)
* Fix [API] [Bug] CreateRepo missing information * add code comment Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
772b5e0f54
commit
07995e2301
1 changed files with 6 additions and 0 deletions
|
@ -257,6 +257,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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue