summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/watch.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/user/watch.go')
-rw-r--r--routers/api/v1/user/watch.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go
index 718a9282ed..22e76f5ebc 100644
--- a/routers/api/v1/user/watch.go
+++ b/routers/api/v1/user/watch.go
@@ -60,9 +60,8 @@ func GetWatchedRepos(ctx *context.APIContext) {
// "200":
// "$ref": "#/responses/RepositoryList"
- user := GetUserByParams(ctx)
- private := user.ID == ctx.Doer.ID
- repos, total, err := getWatchedRepos(user, private, utils.GetListOptions(ctx))
+ private := ctx.ContextUser.ID == ctx.Doer.ID
+ repos, total, err := getWatchedRepos(ctx.ContextUser, private, utils.GetListOptions(ctx))
if err != nil {
ctx.Error(http.StatusInternalServerError, "getWatchedRepos", err)
}