[MM-24522] remove duplication in OR and IncludeDeletedChannels params for search (#14573)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2b1da58e6d
Коммит
f12ca27bac
@@ -1804,12 +1804,16 @@ func (s *SqlPostStore) GetDirectPostParentsForExportAfter(limit int, afterId str
|
||||
return posts, nil
|
||||
}
|
||||
|
||||
func (s *SqlPostStore) SearchPostsInTeamForUser(paramsList []*model.SearchParams, userId, teamId string, isOrSearch, includeDeletedChannels bool, page, perPage int) (*model.PostSearchResults, *model.AppError) {
|
||||
func (s *SqlPostStore) SearchPostsInTeamForUser(paramsList []*model.SearchParams, userId, teamId string, page, perPage int) (*model.PostSearchResults, *model.AppError) {
|
||||
// Since we don't support paging for DB search, we just return nothing for later pages
|
||||
if page > 0 {
|
||||
return model.MakePostSearchResults(model.NewPostList(), nil), nil
|
||||
}
|
||||
|
||||
if err := model.IsSearchParamsListValid(paramsList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
pchan := make(chan store.StoreResult, len(paramsList))
|
||||
@@ -1818,8 +1822,6 @@ func (s *SqlPostStore) SearchPostsInTeamForUser(paramsList []*model.SearchParams
|
||||
// remove any unquoted term that contains only non-alphanumeric chars
|
||||
// ex: abcd "**" && abc >> abcd "**" abc
|
||||
params.Terms = removeNonAlphaNumericUnquotedTerms(params.Terms, " ")
|
||||
params.IncludeDeletedChannels = includeDeletedChannels
|
||||
params.OrTerms = isOrSearch
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user