diff options
Diffstat (limited to 'routers/api/v1/user')
-rw-r--r-- | routers/api/v1/user/repo.go | 3 | ||||
-rw-r--r-- | routers/api/v1/user/watch.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/routers/api/v1/user/repo.go b/routers/api/v1/user/repo.go index 760032460e..3d5c841856 100644 --- a/routers/api/v1/user/repo.go +++ b/routers/api/v1/user/repo.go @@ -8,6 +8,7 @@ import ( "net/http" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/perm" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/context" @@ -118,7 +119,7 @@ func ListMyRepos(ctx *context.APIContext) { results := make([]*api.Repository, len(repos)) for i, repo := range repos { - if err = repo.GetOwner(); err != nil { + if err = repo.GetOwner(db.DefaultContext); err != nil { ctx.Error(http.StatusInternalServerError, "GetOwner", err) return } diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go index 54d5e74bc0..5c7a4d8d89 100644 --- a/routers/api/v1/user/watch.go +++ b/routers/api/v1/user/watch.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + repo_model "code.gitea.io/gitea/models/repo" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" @@ -201,6 +202,6 @@ func Unwatch(ctx *context.APIContext) { } // subscriptionURL returns the URL of the subscription API endpoint of a repo -func subscriptionURL(repo *models.Repository) string { +func subscriptionURL(repo *repo_model.Repository) string { return repo.APIURL() + "/subscription" } |