MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337)

Этот коммит содержится в:
Jesús Espino
2018-09-11 22:45:31 +02:00
коммит произвёл GitHub
родитель d585f9d9a3
Коммит e32581aef3
7 изменённых файлов: 197 добавлений и 0 удалений

Просмотреть файл

@@ -1507,6 +1507,16 @@ func (a *App) AutocompleteChannels(teamId string, term string) (*model.ChannelLi
}
}
func (a *App) AutocompleteChannelsForSearch(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) {
includeDeleted := *a.Config().TeamSettings.ExperimentalViewArchivedChannels
if result := <-a.Srv.Store.Channel().AutocompleteInTeamForSearch(teamId, userId, term, includeDeleted); result.Err != nil {
return nil, result.Err
} else {
return result.Data.(*model.ChannelList), nil
}
}
func (a *App) SearchChannels(teamId string, term string) (*model.ChannelList, *model.AppError) {
includeDeleted := *a.Config().TeamSettings.ExperimentalViewArchivedChannels