-
Notifications
You must be signed in to change notification settings - Fork 937
feat: Single query for all workspaces with optional filter #1537
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
We can remove more routes in favor of this one
for k, v := range assertRoute { | ||
noTrailSlash := strings.TrimRight(k, "/") | ||
if _, ok := assertRoute[noTrailSlash]; ok && noTrailSlash != k { | ||
t.Errorf("route %q & %q is declared twice", noTrailSlash, k) | ||
t.FailNow() | ||
} | ||
assertRoute[noTrailSlash] = v | ||
} |
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.
Routes were being duplicated with a trailing slash. Just catching dev errors.
@@ -131,3 +131,41 @@ func (c *Client) UpdateWorkspaceAutostop(ctx context.Context, id uuid.UUID, req | |||
} | |||
return nil | |||
} | |||
|
|||
type WorkspaceFilter struct { | |||
OrganizationID uuid.UUID |
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.
Should we make OrganizationID
be Organization
, similar to Owner
? Then the organization's name could be used, or its ID.
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.
It would be the first time we use OrganizationName
in the api right? We should probably make a PR to do this everywhere if we decide for it
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 suppose we technically could make organization an ID or name, just like users.
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.
Yea, we just have to do it across more endpoints imo. Should be another PR to do this like the users PR I did
* feat: Add single query for all workspaces using a filter
Filters
Future work