summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/org
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-10 09:27:50 +0800
committerGitHub <noreply@github.com>2021-12-10 09:27:50 +0800
commit719bddcd76610a63dadc8555760072957a11cf30 (patch)
tree0df26092fba7e3e21444fe493e6b349473b6b0cb /routers/api/v1/org
parentfb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff)
downloadgitea-719bddcd76610a63dadc8555760072957a11cf30.tar.gz
gitea-719bddcd76610a63dadc8555760072957a11cf30.zip
Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
Diffstat (limited to 'routers/api/v1/org')
-rw-r--r--routers/api/v1/org/team.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go
index 371f1dc86d..074d6fd009 100644
--- a/routers/api/v1/org/team.go
+++ b/routers/api/v1/org/team.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/perm"
+ repo_model "code.gitea.io/gitea/models/repo"
unit_model "code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/convert"
@@ -512,10 +513,10 @@ func GetTeamRepos(ctx *context.APIContext) {
}
// getRepositoryByParams get repository by a team's organization ID and repo name
-func getRepositoryByParams(ctx *context.APIContext) *models.Repository {
- repo, err := models.GetRepositoryByName(ctx.Org.Team.OrgID, ctx.Params(":reponame"))
+func getRepositoryByParams(ctx *context.APIContext) *repo_model.Repository {
+ repo, err := repo_model.GetRepositoryByName(ctx.Org.Team.OrgID, ctx.Params(":reponame"))
if err != nil {
- if models.IsErrRepoNotExist(err) {
+ if repo_model.IsErrRepoNotExist(err) {
ctx.NotFound()
} else {
ctx.Error(http.StatusInternalServerError, "GetRepositoryByName", err)