From d3b31cc1ee752e09e3062213eb4c34a6e9b0d7ff Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Feb 2022 20:09:24 +0100 Subject: Add `GetUserTeams` (#18499) * COrrect use `UserID` in `SearchTeams` - Use `UserID` in the `SearchTeams` function, currently it was useless to pass such information. Now it does a INNER statement to `team_user` which obtains UserID -> TeamID data. - Make OrgID optional. - Resolves #18484 * Seperate searching specific user * Add condition back * Use correct struct type Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao Co-authored-by: wxiaoguang Co-authored-by: techknowlogick --- modules/repository/create_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/repository/create_test.go b/modules/repository/create_test.go index ed890ace43..4e232a8609 100644 --- a/modules/repository/create_test.go +++ b/modules/repository/create_test.go @@ -23,7 +23,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) { testTeamRepositories := func(teamID int64, repoIds []int64) { team := unittest.AssertExistsAndLoadBean(t, &models.Team{ID: teamID}).(*models.Team) - assert.NoError(t, team.GetRepositories(&models.SearchTeamOptions{}), "%s: GetRepositories", team.Name) + assert.NoError(t, team.GetRepositories(&models.SearchOrgTeamOptions{}), "%s: GetRepositories", team.Name) assert.Len(t, team.Repos, team.NumRepos, "%s: len repo", team.Name) assert.Len(t, team.Repos, len(repoIds), "%s: repo count", team.Name) for i, rid := range repoIds { -- cgit v1.2.3