Skip to content

Commit 11da452

Browse files
committed
fix: kotlin
1 parent 25f4f13 commit 11da452

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

templates/kotlin/guides/search/saveObjectsMCM.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ val getAllAppIDConfigurations: () -> Map<String, String> = {
77
mapOf() // A map of your MCM AppID/ApiKey pairs
88
}
99

10-
val playlists: List<JsonObject> = listOf() // Your records
11-
1210
suspend fun saveObjectsMCM() {
11+
val playlists: List<JsonObject> = listOf() // Your records
12+
1313
val configurations = getAllAppIDConfigurations()
1414
1515
configurations.map { (appID, apiKey) ->

templates/kotlin/guides/search/saveObjectsPublicUser.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import kotlinx.serialization.json.JsonObject
44
import com.algolia.client.model.search.*
55
import com.algolia.client.transport.RequestOptions
66

7-
val playlists: List<JsonObject> = listOf() // Your records
7+
suspend fun saveObjectsPublicUser() {
8+
val playlists: List<JsonObject> = listOf() // Your records
89
9-
suspend fun saveObjectsPublicUser() {
1010
{{> snippets/init}}
1111

1212
client.{{#dynamicSnippet}}saveObjectsPlaylistsWithUserIDPublic{{/dynamicSnippet}}

templates/kotlin/guides/search/savePopularRecords.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import kotlinx.serialization.json.buildJsonObject
22
import kotlinx.serialization.json.JsonObject
3+
import kotlinx.serialization.json.JsonPrimitive
34

45
{{> snippets/import}}
56
import com.algolia.client.model.search.*
@@ -9,7 +10,7 @@ suspend fun savePopularRecords() {
910

1011
var records: List<JsonObject> = listOf()
1112

12-
client.browseObjects(indexName, BrowseParamsObject(), aggregator = { response ->
13+
client.browseObjects("YOUR_INDEX_NAME", BrowseParamsObject(), aggregator = { response ->
1314
records = records + response.hits.map { hit ->
1415
val props = hit.additionalProperties ?: mapOf()
1516

templates/kotlin/guides/search/setHeaderUserIDThenSaveObjects.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import kotlinx.serialization.json.JsonObject
2+
13
{{> snippets/import}}
24
import com.algolia.client.model.search.*
35

4-
val playlists: List<Map<String, Any>> = listOf() // Your records
5-
66
suspend fun setHeaderUserIDThenSaveObjects() {
7+
val playlists: List<JsonObject> = listOf() // Your records
8+
79
{{> snippets/init}}
810

911
playlists.foreach { playlist ->

0 commit comments

Comments
 (0)