mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-7826: Don't fetch posts from store if ES returns none. (#7596)
This commit is contained in:
14
app/post.go
14
app/post.go
@@ -602,12 +602,14 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
|
|||||||
|
|
||||||
// Get the posts
|
// Get the posts
|
||||||
postList := model.NewPostList()
|
postList := model.NewPostList()
|
||||||
if presult := <-a.Srv.Store.Post().GetPostsByIds(postIds); presult.Err != nil {
|
if len(postIds) > 0 {
|
||||||
return nil, presult.Err
|
if presult := <-a.Srv.Store.Post().GetPostsByIds(postIds); presult.Err != nil {
|
||||||
} else {
|
return nil, presult.Err
|
||||||
for _, p := range presult.Data.([]*model.Post) {
|
} else {
|
||||||
postList.AddPost(p)
|
for _, p := range presult.Data.([]*model.Post) {
|
||||||
postList.AddOrder(p.Id)
|
postList.AddPost(p)
|
||||||
|
postList.AddOrder(p.Id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user