chore: implement filters for the organizations query (#14468)

Required for organization sync. Allows fetching a filtered set of orgs.
This commit is contained in:
Steven Masley
2024-08-28 13:24:28 -05:00
committed by GitHub
parent 7667d64686
commit 54fe082551
13 changed files with 67 additions and 26 deletions

View File

@ -516,7 +516,7 @@ func TestDefaultOrg(t *testing.T) {
ctx := context.Background()
// Should start with the default org
all, err := db.GetOrganizations(ctx)
all, err := db.GetOrganizations(ctx, database.GetOrganizationsParams{})
require.NoError(t, err)
require.Len(t, all, 1)
require.True(t, all[0].IsDefault, "first org should always be default")
@ -1211,7 +1211,7 @@ func TestExpectOne(t *testing.T) {
dbgen.Organization(t, db, database.Organization{})
// Organizations is an easy table without foreign key dependencies
_, err = database.ExpectOne(db.GetOrganizations(ctx))
_, err = database.ExpectOne(db.GetOrganizations(ctx, database.GetOrganizationsParams{}))
require.ErrorContains(t, err, "too many rows returned")
})
}