From df1e7d0067bb39913eb681ccc920649884fb1938 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 24 Nov 2023 11:49:41 +0800 Subject: Use db.Find instead of writing methods for every object (#28084) For those simple objects, it's unnecessary to write the find and count methods again and again. --- tests/integration/auth_ldap_test.go | 2 +- tests/integration/org_count_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/integration/auth_ldap_test.go b/tests/integration/auth_ldap_test.go index 9bb9e7b3c7..1148b3ad39 100644 --- a/tests/integration/auth_ldap_test.go +++ b/tests/integration/auth_ldap_test.go @@ -414,7 +414,7 @@ func TestLDAPGroupTeamSyncAddMember(t *testing.T) { user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ Name: gitLDAPUser.UserName, }) - usersOrgs, err := organization.FindOrgs(db.DefaultContext, organization.FindOrgOptions{ + usersOrgs, err := db.Find[organization.Organization](db.DefaultContext, organization.FindOrgOptions{ UserID: user.ID, IncludePrivate: true, }) diff --git a/tests/integration/org_count_test.go b/tests/integration/org_count_test.go index d1aa41963e..6386f53f05 100644 --- a/tests/integration/org_count_test.go +++ b/tests/integration/org_count_test.go @@ -118,7 +118,7 @@ func doCheckOrgCounts(username string, orgCounts map[string]int, strict bool, ca Name: username, }) - orgs, err := organization.FindOrgs(db.DefaultContext, organization.FindOrgOptions{ + orgs, err := db.Find[organization.Organization](db.DefaultContext, organization.FindOrgOptions{ UserID: user.ID, IncludePrivate: true, }) -- cgit v1.2.3