summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-09-11 22:45:31 +0200
committerGitHub <noreply@github.com>2018-09-11 22:45:31 +0200
commite32581aef3253bb0691d6fd678fbf01e86f2c10c (patch)
tree895aff7c6cc2e43a5209bb3c7b19384f13c5b105 /app/channel.go
parentd585f9d9a3bd7c272a02e1d3d52990bc6ecb37a3 (diff)
downloadchat-e32581aef3253bb0691d6fd678fbf01e86f2c10c.tar.gz
chat-e32581aef3253bb0691d6fd678fbf01e86f2c10c.tar.bz2
chat-e32581aef3253bb0691d6fd678fbf01e86f2c10c.zip
MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337)
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/channel.go b/app/channel.go
index 0ac2894fb..4867908f9 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -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