Skip to content

Commit 303e7c1

Browse files
authored
feat(browse): Implement browse POST request (#622)
1 parent 8845e03 commit 303e7c1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/scala/algolia/definitions/BrowseIndexDefinition.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525

2626
package algolia.definitions
2727

28-
import algolia.http.{GET, HttpPayload}
28+
import algolia.http.{HttpPayload, POST}
2929
import algolia.objects.{Query, RequestOptions}
3030
import org.json4s.Formats
31+
import org.json4s.native.Serialization.write
3132

3233
case class BrowseIndexDefinition(
3334
source: String,
@@ -48,11 +49,12 @@ case class BrowseIndexDefinition(
4849

4950
override private[algolia] def build(): HttpPayload = {
5051
val q = query.getOrElse(Query()).copy(cursor = cursor)
52+
val body = Map("params" -> q.toParam)
5153

5254
HttpPayload(
53-
GET,
55+
POST,
5456
Seq("1", "indexes", source, "browse"),
55-
queryParameters = Some(q.toQueryParam),
57+
body = Some(write(body)),
5658
isSearch = true,
5759
requestOptions = requestOptions
5860
)

0 commit comments

Comments
 (0)