1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Introduce OrgList and add LoadTeams, optimaze Load teams for orgs (#32543)

This commit is contained in:
Lunny Xiao
2024-11-26 13:55:06 -08:00
committed by GitHub
parent b6ce2d6dc9
commit f49d82309b
4 changed files with 47 additions and 5 deletions

View File

@@ -126,3 +126,8 @@ func GetUserRepoTeams(ctx context.Context, orgID, userID, repoID int64) (teams T
And("team_repo.repo_id=?", repoID).
Find(&teams)
}
func GetTeamsByOrgIDs(ctx context.Context, orgIDs []int64) (TeamList, error) {
teams := make([]*Team, 0, 10)
return teams, db.GetEngine(ctx).Where(builder.In("org_id", orgIDs)).Find(&teams)
}