diff options
Diffstat (limited to 'routers/api/v1/repo/teams.go')
-rw-r--r-- | routers/api/v1/repo/teams.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo/teams.go b/routers/api/v1/repo/teams.go index 47c69d722b..f485f2086e 100644 --- a/routers/api/v1/repo/teams.go +++ b/routers/api/v1/repo/teams.go @@ -12,6 +12,7 @@ import ( "code.gitea.io/gitea/models/organization" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" + org_service "code.gitea.io/gitea/services/org" ) // ListTeams list a repository's teams @@ -199,7 +200,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 = models.AddRepository(team, ctx.Repo.Repository) + err = org_service.TeamAddRepository(team, ctx.Repo.Repository) } else { if !repoHasTeam { ctx.Error(http.StatusUnprocessableEntity, "notAdded", fmt.Errorf("team '%s' was not added to repo", team.Name)) |