aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/user')
-rw-r--r--routers/api/v1/user/star.go7
-rw-r--r--routers/api/v1/user/watch.go6
2 files changed, 3 insertions, 10 deletions
diff --git a/routers/api/v1/user/star.go b/routers/api/v1/user/star.go
index 0937fd1903..47d3ed5079 100644
--- a/routers/api/v1/user/star.go
+++ b/routers/api/v1/user/star.go
@@ -18,13 +18,10 @@ func getStarredRepos(userID int64, private bool) ([]*api.Repository, error) {
if err != nil {
return nil, err
}
- user, err := models.GetUserByID(userID)
- if err != nil {
- return nil, err
- }
+
repos := make([]*api.Repository, len(starredRepos))
for i, starred := range starredRepos {
- access, err := models.AccessLevel(user, starred)
+ access, err := models.AccessLevel(userID, starred)
if err != nil {
return nil, err
}
diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go
index 6a9ad670d0..2a94e219fe 100644
--- a/routers/api/v1/user/watch.go
+++ b/routers/api/v1/user/watch.go
@@ -31,14 +31,10 @@ func getWatchedRepos(userID int64, private bool) ([]*api.Repository, error) {
if err != nil {
return nil, err
}
- user, err := models.GetUserByID(userID)
- if err != nil {
- return nil, err
- }
repos := make([]*api.Repository, len(watchedRepos))
for i, watched := range watchedRepos {
- access, err := models.AccessLevel(user, watched)
+ access, err := models.AccessLevel(userID, watched)
if err != nil {
return nil, err
}