APIv4 DELETE /users/{user_id}/posts/{post_id}/reactions/name (#6117)
* APIv4 DELETE /users/{user_id}/posts/{post_id}/reactions/name
* updated v3 deleteReaction endpoint
* update parameter of app.DeleteReactionForPost()
* update utils.IsValidAlphaNum, add utils.IsValidAlphaNumHyphenUnderscore, and add related tests
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
e62afeace0
Коммит
ecb10ed62f
@@ -2533,3 +2533,13 @@ func (c *Client4) GetReactions(postId string) ([]*Reaction, *Response) {
|
||||
return ReactionsFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteReaction deletes reaction of a user in a post.
|
||||
func (c *Client4) DeleteReaction(reaction *Reaction) (bool, *Response) {
|
||||
if r, err := c.DoApiDelete(c.GetUserRoute(reaction.UserId) + c.GetPostRoute(reaction.PostId) + fmt.Sprintf("/reactions/%v", reaction.EmojiName)); err != nil {
|
||||
return false, &Response{StatusCode: r.StatusCode, Error: err}
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user