mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add User To Channel api route returns a 400 error when trying to add users to a DM or GM channel (#7587)
This commit is contained in:
committed by
Joram Wilander
parent
fe41022353
commit
a7afadec3a
@@ -826,6 +826,11 @@ func addChannelMember(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if channel.Type == model.CHANNEL_DIRECT || channel.Type == model.CHANNEL_GROUP {
|
||||
c.Err = model.NewAppError("addUserToChannel", "api.channel.add_user_to_channel.type.app_error", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
if cm, err := c.App.AddChannelMember(member.UserId, channel, c.Session.UserId); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user