summaryrefslogtreecommitdiffstats
path: root/api4/api.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-16 14:58:33 -0400
committerCorey Hulen <corey@hulen.com>2017-03-16 11:58:33 -0700
commitd757645c2490dd4f0de16cc32e05551b1476d0a0 (patch)
tree5d6e4049aa296b7629a34ca5b02d0aba25dd27dc /api4/api.go
parent04c0223c6402b12e67c61474ae310b0a56af6482 (diff)
downloadchat-d757645c2490dd4f0de16cc32e05551b1476d0a0.tar.gz
chat-d757645c2490dd4f0de16cc32e05551b1476d0a0.tar.bz2
chat-d757645c2490dd4f0de16cc32e05551b1476d0a0.zip
Implement some channel endpoints for APIv4 (#5767)
Diffstat (limited to 'api4/api.go')
-rw-r--r--api4/api.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/api4/api.go b/api4/api.go
index 422af7b7b..75f2e0254 100644
--- a/api4/api.go
+++ b/api4/api.go
@@ -35,6 +35,7 @@ type Routes struct {
Channels *mux.Router // 'api/v4/channels'
Channel *mux.Router // 'api/v4/channels/{channel_id:[A-Za-z0-9]+}'
+ ChannelForUser *mux.Router // 'api/v4/users/{user_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}'
ChannelByName *mux.Router // 'api/v4/teams/{team_id:[A-Za-z0-9]+}/channels/name/{channel_name:[A-Za-z0-9_-]+}'
ChannelByNameForTeamName *mux.Router // 'api/v4/teams/name/{team_name:[A-Za-z0-9_-]+}/channels/name/{channel_name:[A-Za-z0-9_-]+}'
ChannelsForTeam *mux.Router // 'api/v4/teams/{team_id:[A-Za-z0-9]+}/channels'
@@ -113,6 +114,7 @@ func InitApi(full bool) {
BaseRoutes.Channels = BaseRoutes.ApiRoot.PathPrefix("/channels").Subrouter()
BaseRoutes.Channel = BaseRoutes.Channels.PathPrefix("/{channel_id:[A-Za-z0-9]+}").Subrouter()
+ BaseRoutes.ChannelForUser = BaseRoutes.User.PathPrefix("/channels/{channel_id:[A-Za-z0-9]+}").Subrouter()
BaseRoutes.ChannelByName = BaseRoutes.Team.PathPrefix("/channels/name/{channel_name:[A-Za-z0-9_-]+}").Subrouter()
BaseRoutes.ChannelByNameForTeamName = BaseRoutes.TeamByName.PathPrefix("/channels/name/{channel_name:[A-Za-z0-9_-]+}").Subrouter()
BaseRoutes.ChannelsForTeam = BaseRoutes.Team.PathPrefix("/channels").Subrouter()