[PLT-7362] Add post' root ID to APIv4 addChannelMember to render added user (as system post) at RHS (#7730)
* add post' root ID to apiv4 addChannelMember to render added user (as system post) at RHS * add check to post_root_id parameter * add AddChannelMemberWithRootId function for backward compatibility
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
3024525c3b
Коммит
709ef99eca
@@ -1663,6 +1663,17 @@ func (c *Client4) AddChannelMember(channelId, userId string) (*ChannelMember, *R
|
||||
}
|
||||
}
|
||||
|
||||
// AddChannelMemberWithRootId adds user to channel and return a channel member. Post add to channel message has the postRootId.
|
||||
func (c *Client4) AddChannelMemberWithRootId(channelId, userId, postRootId string) (*ChannelMember, *Response) {
|
||||
requestBody := map[string]string{"user_id": userId, "post_root_id": postRootId}
|
||||
if r, err := c.DoApiPost(c.GetChannelMembersRoute(channelId)+"", MapToJson(requestBody)); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return ChannelMemberFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// RemoveUserFromChannel will delete the channel member object for a user, effectively removing the user from a channel.
|
||||
func (c *Client4) RemoveUserFromChannel(channelId, userId string) (bool, *Response) {
|
||||
if r, err := c.DoApiDelete(c.GetChannelMemberRoute(channelId, userId)); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user