MM-25261: Add 'include_deleted' parameter to get all channels API req… (#14721)

* MM-25261: Add 'include_deleted' parameter to get all channels API request.

* MM-25261: Adds test for deleted channels.

* MM-25261: Switches to single liner.

* MM-25261: Adhere to beta config setting for viewing archived channels.

* MM-25261: Test fix.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Martin Kraft
2020-06-19 16:53:37 -04:00
коммит произвёл GitHub
родитель d391fd6231
Коммит 6158e91308
4 изменённых файлов: 49 добавлений и 1 удалений

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

@@ -1570,6 +1570,7 @@ func (a *App) GetChannelsForUser(teamId string, userId string, includeDeleted bo
}
func (a *App) GetAllChannels(page, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) {
opts.IncludeDeleted = *a.Config().TeamSettings.ExperimentalViewArchivedChannels && opts.IncludeDeleted
if opts.ExcludeDefaultChannels {
opts.ExcludeChannelNames = a.DefaultChannelNames()
}