diff options
author | Chris <ccbrown112@gmail.com> | 2018-01-31 08:26:40 -0600 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-01-31 09:26:40 -0500 |
commit | e0ee73ef9963ab398bcc6011795ad23e8e003147 (patch) | |
tree | 37c773074588792a3badd2a68dfbbdbfa459164d /app/channel.go | |
parent | 0c8968fb8df4ce302c928118cd81e75f5bef2861 (diff) | |
download | chat-e0ee73ef9963ab398bcc6011795ad23e8e003147.tar.gz chat-e0ee73ef9963ab398bcc6011795ad23e8e003147.tar.bz2 chat-e0ee73ef9963ab398bcc6011795ad23e8e003147.zip |
ABC-79: Optimize channel autocomplete query (#8163)
* optimize channel autocomplete query
* move to new autocomplete endpoint
Diffstat (limited to 'app/channel.go')
-rw-r--r-- | app/channel.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/channel.go b/app/channel.go index 0054fe14b..e4bf48654 100644 --- a/app/channel.go +++ b/app/channel.go @@ -1255,6 +1255,14 @@ func (a *App) UpdateChannelLastViewedAt(channelIds []string, userId string) *mod return nil } +func (a *App) AutocompleteChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { + if result := <-a.Srv.Store.Channel().AutocompleteInTeam(teamId, term); 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) { if result := <-a.Srv.Store.Channel().SearchInTeam(teamId, term); result.Err != nil { return nil, result.Err |