MM-38164: Paginate the GetPostThread API (#19485)
We implement a cursor based pagination model to page through the posts in a given thread. The cursor is a combination of the post.CreateAt+ post.Id to differentiate multiple posts in a given timestamp. Some additional parameters like direction, fromPost, fromCreateAt and perPage were introduced to implement this. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ad5f57b161
Коммит
c1f3827801
@@ -110,7 +110,10 @@ func (s SearchPostStore) Delete(postId string, date int64, deletedByID string) e
|
||||
err := s.PostStore.Delete(postId, date, deletedByID)
|
||||
|
||||
if err == nil {
|
||||
postList, err2 := s.PostStore.Get(context.Background(), postId, true, false, false, "")
|
||||
opts := model.GetPostsOptions{
|
||||
SkipFetchThreads: true,
|
||||
}
|
||||
postList, err2 := s.PostStore.Get(context.Background(), postId, opts, "")
|
||||
if postList != nil && len(postList.Order) > 0 {
|
||||
if err2 != nil {
|
||||
s.deletePostIndex(postList.Posts[postList.Order[0]])
|
||||
|
||||
Ссылка в новой задаче
Block a user