Skip to content

Commit

Permalink
Fix [API] [Bug] CreateRepo missing information (go-gitea#12848)
Browse files Browse the repository at this point in the history
* Fix [API] [Bug] CreateRepo missing information

* add code comment

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
6543 and lunny committed Sep 15, 2020
1 parent 3a02f08 commit 4f7a306
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routers/api/v1/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 4f7a306

Please sign in to comment.