Add sort query parameter to GET /emojis (#8121)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
9d6a9ff4be
Коммит
a844577535
@@ -3023,6 +3023,18 @@ func (c *Client4) GetEmojiList(page, perPage int) ([]*Emoji, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetSortedEmojiList returns a page of custom emoji on the system sorted based on the sort
|
||||
// parameter, blank for no sorting and "name" to sort by emoji names.
|
||||
func (c *Client4) GetSortedEmojiList(page, perPage int, sort string) ([]*Emoji, *Response) {
|
||||
query := fmt.Sprintf("?page=%v&per_page=%v&sort=%v", page, perPage, sort)
|
||||
if r, err := c.DoApiGet(c.GetEmojisRoute()+query, ""); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return EmojiListFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteEmoji delete an custom emoji on the provided emoji id string.
|
||||
func (c *Client4) DeleteEmoji(emojiId string) (bool, *Response) {
|
||||
if r, err := c.DoApiDelete(c.GetEmojiRoute(emojiId)); err != nil {
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
const (
|
||||
EMOJI_NAME_MAX_LENGTH = 64
|
||||
EMOJI_SORT_BY_NAME = "name"
|
||||
)
|
||||
|
||||
type Emoji struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user