MM-16499: Adds ability to retrieve channels with total count f… (#11375)

* MM-16499: Adds ability to retrieve channels with total count for pagination.

* MM-16499: Switches to custom package name for squirrel.
Этот коммит содержится в:
Martin Kraft
2019-06-25 08:18:48 -04:00
коммит произвёл Eli Yukelzon
родитель 3993cac4ed
Коммит d1b1b319cf
10 изменённых файлов: 175 добавлений и 25 удалений

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

@@ -1243,6 +1243,18 @@ func (a *App) GetAllChannels(page, perPage int, opts model.ChannelSearchOpts) (*
return a.Srv.Store.Channel().GetAllChannels(page*perPage, perPage, storeOpts)
}
func (a *App) GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.AppError) {
if opts.ExcludeDefaultChannels {
opts.ExcludeChannelNames = a.DefaultChannelNames()
}
storeOpts := store.ChannelSearchOpts{
ExcludeChannelNames: opts.ExcludeChannelNames,
NotAssociatedToGroup: opts.NotAssociatedToGroup,
IncludeDeleted: opts.IncludeDeleted,
}
return a.Srv.Store.Channel().GetAllChannelsCount(storeOpts)
}
func (a *App) GetDeletedChannels(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) {
return a.Srv.Store.Channel().GetDeleted(teamId, offset, limit)
}