Skip to content

Commit

Permalink
Merge branch 'v2' into kostas/user-683
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonRomano authored Nov 12, 2024
2 parents 0d2d9a1 + ccc1847 commit 1b64d7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Next release

- Add support for bulk invitation creation with the `invitation.BulkCreate` method.
- Add `NameQuery` to `user.ListParams`.

## 2.1.1

Expand Down
4 changes: 4 additions & 0 deletions user/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ type ListParams struct {
EmailAddressQuery *string `json:"email_address_query,omitempty"`
PhoneNumberQuery *string `json:"phone_number_query,omitempty"`
UsernameQuery *string `json:"username_query,omitempty"`
NameQuery *string `json:"name_query,omitempty"`
EmailAddresses []string `json:"email_address,omitempty"`
ExternalIDs []string `json:"external_id,omitempty"`
PhoneNumbers []string `json:"phone_number,omitempty"`
Expand Down Expand Up @@ -251,6 +252,9 @@ func (params *ListParams) ToQuery() url.Values {
if params.UsernameQuery != nil {
q.Add("username_query", *params.UsernameQuery)
}
if params.NameQuery != nil {
q.Add("name_query", *params.NameQuery)
}
for _, v := range params.EmailAddresses {
q.Add("email_address", v)
}
Expand Down
2 changes: 2 additions & 0 deletions user/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestUserClientList_Request(t *testing.T) {
"email_address": []string{"[email protected]", "[email protected]"},
"organization_id": []string{"org_123", "org_456"},
"email_address_query": []string{"@bar.com"},
"name_query": []string{"foobar"},
"created_at_before": []string{"1730333164378"},
"created_at_after": []string{"1730333164378"},
"last_active_at_before": []string{"1730333164378"},
Expand All @@ -66,6 +67,7 @@ func TestUserClientList_Request(t *testing.T) {
OrderBy: clerk.String("-created_at"),
OrganizationIDs: []string{"org_123", "org_456"},
EmailAddressQuery: clerk.String("@bar.com"),
NameQuery: clerk.String("foobar"),
}
params.Limit = clerk.Int64(1)
params.Offset = clerk.Int64(2)
Expand Down

0 comments on commit 1b64d7f

Please sign in to comment.