aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/teams.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-11-27 13:12:26 -0800
committerGitHub <noreply@github.com>2024-11-27 21:12:26 +0000
commitf62f68cbdda07ae6933b4804bc757f35dc92d134 (patch)
tree6709319ec99caa6b22ed7d409f77ad17323f7808 /routers/api/v1/repo/teams.go
parent5a50b271e71b5e8bb7bdef149e07dcd2b0db3e3a (diff)
downloadgitea-f62f68cbdda07ae6933b4804bc757f35dc92d134.tar.gz
gitea-f62f68cbdda07ae6933b4804bc757f35dc92d134.zip
Move team related functions to service layer (#32537)
There are still some functions under `models` after last big refactor about `models`. This change will move all team related functions to service layer with no code change.
Diffstat (limited to 'routers/api/v1/repo/teams.go')
-rw-r--r--routers/api/v1/repo/teams.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/api/v1/repo/teams.go b/routers/api/v1/repo/teams.go
index ddd325482d..82ecaf3020 100644
--- a/routers/api/v1/repo/teams.go
+++ b/routers/api/v1/repo/teams.go
@@ -10,7 +10,6 @@ import (
"code.gitea.io/gitea/models/organization"
"code.gitea.io/gitea/services/context"
"code.gitea.io/gitea/services/convert"
- org_service "code.gitea.io/gitea/services/org"
repo_service "code.gitea.io/gitea/services/repository"
)
@@ -205,7 +204,7 @@ func changeRepoTeam(ctx *context.APIContext, add bool) {
ctx.Error(http.StatusUnprocessableEntity, "alreadyAdded", fmt.Errorf("team '%s' is already added to repo", team.Name))
return
}
- err = org_service.TeamAddRepository(ctx, team, ctx.Repo.Repository)
+ err = repo_service.TeamAddRepository(ctx, team, ctx.Repo.Repository)
} else {
if !repoHasTeam {
ctx.Error(http.StatusUnprocessableEntity, "notAdded", fmt.Errorf("team '%s' was not added to repo", team.Name))