Skip to content

Commit

Permalink
feat: Enable sorting by specific field in GetMessageMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmani committed Nov 5, 2023
1 parent 77833c9 commit 31e29f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,16 @@ func (c *Client) GetMessageMetadataPage(ctx context.Context, page, pageSize int,

Page int
PageSize int

Sort string
}{
MessageFilter: filter,

Page: page,
PageSize: pageSize,
}

Sort: "ID",
/* keep default sort to maintain backward compatibility */
if req.Sort == "" {
req.Sort = "ID"
}

for {
Expand Down
1 change: 1 addition & 0 deletions message_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type MessageFilter struct {
ExternalID string `json:",omitempty"`
LabelID string `json:",omitempty"`
EndID string `json:",omitempty"`
Sort string `json:",omitempty"`
Desc Bool
}

Expand Down

0 comments on commit 31e29f1

Please sign in to comment.