[MM-28124] api4/post: return error at getFlaggedPostsForUser (#15493)
* api4/post: return error at getFlaggedPostsForUser * api4/post_test: add additional test case for GetFlaggedPosts * reflect review comments Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7bd18264fd
Коммит
c8c7fe0f4f
10
api4/post.go
10
api4/post.go
@@ -295,6 +295,10 @@ func getFlaggedPostsForUser(c *Context, w http.ResponseWriter, r *http.Request)
|
||||
} else {
|
||||
posts, err = c.App.GetFlaggedPosts(c.Params.UserId, c.Params.Page, c.Params.PerPage)
|
||||
}
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
pl := model.NewPostList()
|
||||
channelReadPermission := make(map[string]bool)
|
||||
@@ -321,12 +325,6 @@ func getFlaggedPostsForUser(c *Context, w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
pl.SortByCreateAt()
|
||||
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
w.Write([]byte(c.App.PreparePostListForClient(pl).ToJson()))
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user