mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
feat: support filtering users table by login type (#17238)
#15896 Mentions ability to add support for filtering by login type The issue mentions that backend API support exists but the backend did not seem to have the support for this filter. So I have added the ability to filter it. I also added a corresponding update to readme file to make sure the docs will correctly showcase this feature
This commit is contained in:
@ -28,7 +28,8 @@ type UsersRequest struct {
|
||||
// Filter users by status.
|
||||
Status UserStatus `json:"status,omitempty" typescript:"-"`
|
||||
// Filter users that have the given role.
|
||||
Role string `json:"role,omitempty" typescript:"-"`
|
||||
Role string `json:"role,omitempty" typescript:"-"`
|
||||
LoginType []LoginType `json:"login_type,omitempty" typescript:"-"`
|
||||
|
||||
SearchQuery string `json:"q,omitempty"`
|
||||
Pagination
|
||||
@ -755,6 +756,9 @@ func (c *Client) Users(ctx context.Context, req UsersRequest) (GetUsersResponse,
|
||||
if req.SearchQuery != "" {
|
||||
params = append(params, req.SearchQuery)
|
||||
}
|
||||
for _, lt := range req.LoginType {
|
||||
params = append(params, "login_type:"+string(lt))
|
||||
}
|
||||
q.Set("q", strings.Join(params, " "))
|
||||
r.URL.RawQuery = q.Encode()
|
||||
},
|
||||
|
Reference in New Issue
Block a user