summaryrefslogtreecommitdiffstats
path: root/api/api.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-06-06 13:03:56 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-06-06 13:03:56 -0400
commit384d0eb245e2aa325fdcfe2d8ee22a40c91af589 (patch)
treec61bbf3241625d766fa81fbebf7395db3ef3521d /api/api.go
parent2c42294bbcab3cd5cfdce9604e5872fe4a12e538 (diff)
downloadchat-384d0eb245e2aa325fdcfe2d8ee22a40c91af589.tar.gz
chat-384d0eb245e2aa325fdcfe2d8ee22a40c91af589.tar.bz2
chat-384d0eb245e2aa325fdcfe2d8ee22a40c91af589.zip
PLT-2559 Always return successful when trying to join a channel that the user is already a member of (#3265)
* Added unit tests for SqlChannelStore.GetMember * Fixed api routes for accessing channels by name when the name includes an underscore * Changed join channel API to always return successful when the user is already a member of the channel
Diffstat (limited to 'api/api.go')
-rw-r--r--api/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/api.go b/api/api.go
index 63a460dc5..3404e0c0b 100644
--- a/api/api.go
+++ b/api/api.go
@@ -25,7 +25,7 @@ type Routes struct {
Channels *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels'
NeedChannel *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}'
- NeedChannelName *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/name/{channel_name:[A-Za-z0-9-]+}'
+ NeedChannelName *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/name/{channel_name:[A-Za-z0-9_-]+}'
Posts *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}/posts'
NeedPost *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}/posts/{post_id:[A-Za-z0-9]+}'
@@ -60,7 +60,7 @@ func InitApi() {
BaseRoutes.NeedTeam = BaseRoutes.Teams.PathPrefix("/{team_id:[A-Za-z0-9]+}").Subrouter()
BaseRoutes.Channels = BaseRoutes.NeedTeam.PathPrefix("/channels").Subrouter()
BaseRoutes.NeedChannel = BaseRoutes.Channels.PathPrefix("/{channel_id:[A-Za-z0-9]+}").Subrouter()
- BaseRoutes.NeedChannelName = BaseRoutes.Channels.PathPrefix("/name/{channel_name:[A-Za-z0-9-]+}").Subrouter()
+ BaseRoutes.NeedChannelName = BaseRoutes.Channels.PathPrefix("/name/{channel_name:[A-Za-z0-9_-]+}").Subrouter()
BaseRoutes.Posts = BaseRoutes.NeedChannel.PathPrefix("/posts").Subrouter()
BaseRoutes.NeedPost = BaseRoutes.Posts.PathPrefix("/{post_id:[A-Za-z0-9]+}").Subrouter()
BaseRoutes.Commands = BaseRoutes.NeedTeam.PathPrefix("/commands").Subrouter()