diff options
Diffstat (limited to 'routers/api/v1/user/star.go')
-rw-r--r-- | routers/api/v1/user/star.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/api/v1/user/star.go b/routers/api/v1/user/star.go index 95d3785a82..83f97f8f01 100644 --- a/routers/api/v1/user/star.go +++ b/routers/api/v1/user/star.go @@ -62,15 +62,14 @@ func GetStarredRepos(ctx *context.APIContext) { // "200": // "$ref": "#/responses/RepositoryList" - user := GetUserByParams(ctx) - private := user.ID == ctx.Doer.ID - repos, err := getStarredRepos(user, private, utils.GetListOptions(ctx)) + private := ctx.ContextUser.ID == ctx.Doer.ID + repos, err := getStarredRepos(ctx.ContextUser, private, utils.GetListOptions(ctx)) if err != nil { ctx.Error(http.StatusInternalServerError, "getStarredRepos", err) return } - ctx.SetTotalCountHeader(int64(user.NumStars)) + ctx.SetTotalCountHeader(int64(ctx.ContextUser.NumStars)) ctx.JSON(http.StatusOK, &repos) } |