From e32581aef3253bb0691d6fd678fbf01e86f2c10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 11 Sep 2018 22:45:31 +0200 Subject: MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337) --- app/channel.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/channel.go') 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 -- cgit v1.2.3-1-g7c22