diff options
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/model/client4.go b/model/client4.go index 8ca227589..89fed55ff 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1684,8 +1684,8 @@ func (c *Client4) GetPostsBefore(channelId, postId string, page, perPage int, et // SearchPosts returns any posts with matching terms string. func (c *Client4) SearchPosts(teamId string, terms string, isOrSearch bool) (*PostList, *Response) { - requestBody := map[string]string{"terms": terms, "is_or_search": strconv.FormatBool(isOrSearch)} - if r, err := c.DoApiPost(c.GetTeamRoute(teamId)+"/posts/search", MapToJson(requestBody)); err != nil { + requestBody := map[string]interface{}{"terms": terms, "is_or_search": isOrSearch} + if r, err := c.DoApiPost(c.GetTeamRoute(teamId)+"/posts/search", StringInterfaceToJson(requestBody)); err != nil { return nil, BuildErrorResponse(r, err) } else { defer closeBody(r) |