1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-13 14:07:20 +00:00

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.
This commit is contained in:
Lunny Xiao
2024-11-27 13:12:26 -08:00
committed by GitHub
parent 5a50b271e7
commit f62f68cbdd
26 changed files with 452 additions and 483 deletions

View File

@ -12,7 +12,6 @@ import (
"strings"
"time"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/organization"
"code.gitea.io/gitea/models/perm"
@ -448,7 +447,7 @@ func CreateRepositoryByExample(ctx context.Context, doer, u *user_model.User, re
}
for _, t := range teams {
if t.IncludesAllRepositories {
if err := models.AddRepository(ctx, t, repo); err != nil {
if err := addRepositoryToTeam(ctx, t, repo); err != nil {
return fmt.Errorf("AddRepository: %w", err)
}
}