summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-06-28 10:28:17 -0400
committerChristopher Speller <crspeller@gmail.com>2017-06-28 07:28:17 -0700
commite527b6bbe4335f685528d305f8700d555420cf8e (patch)
treeb6623025c365e09bf2bbef69fd1ca60976b9da69 /model
parent3e9b5c277653cef27b30f31c1db090777c22ed9d (diff)
downloadchat-e527b6bbe4335f685528d305f8700d555420cf8e.tar.gz
chat-e527b6bbe4335f685528d305f8700d555420cf8e.tar.bz2
chat-e527b6bbe4335f685528d305f8700d555420cf8e.zip
PLT-6931 Properly parse request body in post search (#6768)
* Properly parse request body in post search * Update driver to use correct body
Diffstat (limited to 'model')
-rw-r--r--model/client4.go4
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)