Skip to content

Commit

Permalink
MessageLimit and MemberLimit should be pointers (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruudniew authored Dec 10, 2020
1 parent 76e0e38 commit f80a88b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type QueryOption struct {
UserID string `json:"user_id,omitempty"`
Limit int `json:"limit,omitempty"` // pagination option: limit number of results
Offset int `json:"offset,omitempty"` // pagination option: offset to return items from
MessageLimit int `json:"message_limit,omitempty"`
MemberLimit int `json:"member_limit,omitempty"`
MessageLimit *int `json:"message_limit,omitempty"`
MemberLimit *int `json:"member_limit,omitempty"`
}

type SortOption struct {
Expand All @@ -32,8 +32,8 @@ type queryRequest struct {
UserID string `json:"user_id,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
MemberLimit int `json:"member_limit,omitempty"`
MessageLimit int `json:"message_limit,omitempty"`
MemberLimit *int `json:"member_limit,omitempty"`
MessageLimit *int `json:"message_limit,omitempty"`

FilterConditions map[string]interface{} `json:"filter_conditions,omitempty"`
Sort []*SortOption `json:"sort,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestClient_QueryChannels(t *testing.T) {
"$eq": ch.ID,
},
},
MessageLimit: messageLimit,
MessageLimit: &messageLimit,
})

require.NoError(t, err, "query channels error")
Expand Down

0 comments on commit f80a88b

Please sign in to comment.