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.
Этот коммит содержится в:
коммит произвёл
Eli Yukelzon
родитель
3993cac4ed
Коммит
d1b1b319cf
@@ -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)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user