Skip to content

Commit 07995e2

Browse files
6543lunny
andauthored
Fix [API] [Bug] CreateRepo missing information (#12848)
* Fix [API] [Bug] CreateRepo missing information * add code comment Co-authored-by: Lunny Xiao <[email protected]>
1 parent 772b5e0 commit 07995e2

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
@@ -257,6 +257,12 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
257257
return
258258
}
259259

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

0 commit comments

Comments
 (0)