summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/channel.go b/app/channel.go
index 50067d42d..16c5dd084 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -757,6 +757,18 @@ func (a *App) GetChannelByName(channelName, teamId string) (*model.Channel, *mod
}
}
+func (a *App) GetChannelsByNames(channelNames []string, teamId string) ([]*model.Channel, *model.AppError) {
+ if result := <-a.Srv.Store.Channel().GetByNames(teamId, channelNames, true); result.Err != nil && result.Err.Id == "store.sql_channel.get_by_name.missing.app_error" {
+ result.Err.StatusCode = http.StatusNotFound
+ return nil, result.Err
+ } else if result.Err != nil {
+ result.Err.StatusCode = http.StatusBadRequest
+ return nil, result.Err
+ } else {
+ return result.Data.([]*model.Channel), nil
+ }
+}
+
func (a *App) GetChannelByNameForTeamName(channelName, teamName string) (*model.Channel, *model.AppError) {
var team *model.Team