MM-31711 - Implement cursor paging for threads (#16748)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bb7e5b6e9d
Коммит
13616cac0f
@@ -5794,8 +5794,11 @@ func (c *Client4) GetUserThreads(userId, teamId string, options GetUserThreadsOp
|
||||
if options.Since != 0 {
|
||||
v.Set("since", fmt.Sprintf("%d", options.Since))
|
||||
}
|
||||
if options.Page != 0 {
|
||||
v.Set("page", fmt.Sprintf("%d", options.Page))
|
||||
if options.Before != "" {
|
||||
v.Set("before", options.Before)
|
||||
}
|
||||
if options.After != "" {
|
||||
v.Set("after", options.After)
|
||||
}
|
||||
if options.PageSize != 0 {
|
||||
v.Set("pageSize", fmt.Sprintf("%d", options.PageSize))
|
||||
|
||||
@@ -34,9 +34,6 @@ type Threads struct {
|
||||
}
|
||||
|
||||
type GetUserThreadsOpts struct {
|
||||
// Page specifies which part of the results to return, by PageSize. Default = 0
|
||||
Page uint64
|
||||
|
||||
// PageSize specifies the size of the returned chunk of results. Default = 30
|
||||
PageSize uint64
|
||||
|
||||
@@ -49,6 +46,12 @@ type GetUserThreadsOpts struct {
|
||||
// Since filters the threads based on their LastUpdateAt timestamp.
|
||||
Since uint64
|
||||
|
||||
// Before specifies thread id as a cursor for pagination and will return `PageSize` threads before the cursor
|
||||
Before string
|
||||
|
||||
// After specifies thread id as a cursor for pagination and will return `PageSize` threads after the cursor
|
||||
After string
|
||||
|
||||
// Unread will make sure that only threads with unread replies are returned
|
||||
Unread bool
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user