- Notifications
You must be signed in to change notification settings - Fork928
chore: add organization search query to workspaces#14474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -95,7 +75,7 @@ func Users(query string) (database.GetUsersParams, []codersdk.ValidationError) { | |||
return filter, parser.Errors | |||
} | |||
func Workspaces(query string, page codersdk.Pagination, agentInactiveDisconnectTimeout time.Duration) (database.GetWorkspacesParams, []codersdk.ValidationError) { | |||
func Workspaces(ctx context.Context, db database.Store,query string, page codersdk.Pagination, agentInactiveDisconnectTimeout time.Duration) (database.GetWorkspacesParams, []codersdk.ValidationError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
aside: I see why we do it in this package, but this is kind of a weird naming scheme for something that returns database query params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Fair. Maybe it should be namedWorkspacesFilter
or something. I won't address here though
db := dbmem.New() | ||
if c.Setup != nil { | ||
c.Setup(t, db) | ||
} | ||
values, errs := searchquery.Workspaces(context.Background(), db, c.Query, codersdk.Pagination{}, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can we not use the traditional way of getting a DB in tests so this can run against postgres too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'd prefer not to for this. What would be even better is if I used the mock database, but I haven't messed with that at all yet.
b96ac67
intomainUh oh!
There was an error while loading.Please reload this page.
Closes#14444