From 66d252bc2b1299a62f7f93f8e8985deb2fbeaa91 Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 31 Jan 2025 14:14:36 +0100 Subject: [PATCH] chore: Remove `GetTeamNamesByID` - Introduced in 9ff4e1d2d9636ea8aa328427f1d31c962221263e and removed in b3a6596b54bdfa75b9f82c4d73185e676c32727f. --- .deadcode-out | 1 - models/organization/team.go | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/.deadcode-out b/.deadcode-out index a5246cb2a7..f63a880743 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -42,7 +42,6 @@ code.gitea.io/gitea/models/issues IsErrIssueWasClosed code.gitea.io/gitea/models/organization - GetTeamNamesByID UpdateTeamUnits SearchMembersOptions.ToConds diff --git a/models/organization/team.go b/models/organization/team.go index ddff32cb8c..5065a1a1d5 100644 --- a/models/organization/team.go +++ b/models/organization/team.go @@ -247,22 +247,6 @@ func GetTeamByID(ctx context.Context, teamID int64) (*Team, error) { return t, nil } -// GetTeamNamesByID returns team's lower name from a list of team ids. -func GetTeamNamesByID(ctx context.Context, teamIDs []int64) ([]string, error) { - if len(teamIDs) == 0 { - return []string{}, nil - } - - var teamNames []string - err := db.GetEngine(ctx).Table("team"). - Select("lower_name"). - In("id", teamIDs). - Asc("name"). - Find(&teamNames) - - return teamNames, err -} - // IncrTeamRepoNum increases the number of repos for the given team by 1 func IncrTeamRepoNum(ctx context.Context, teamID int64) error { _, err := db.GetEngine(ctx).Incr("num_repos").ID(teamID).Update(new(Team))