Skip to content

Commit 98bf2e7

Browse files
committed
feat(kotlin): saveObjectsMCM
1 parent a97b6d0 commit 98bf2e7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{> snippets/import}}
2+
import com.algolia.client.model.search.*
3+
4+
suspend fun saveObjectsMCM() {
5+
val configurations = getAllAppIDConfigurations()
6+
7+
configurations.map { (appID, apiKey) ->
8+
val client = SearchClient(appID, apiKey)
9+
10+
try {
11+
client.{{#dynamicSnippet}}saveObjectsPlaylists{{/dynamicSnippet}}
12+
} catch (e: Exception) {
13+
throw Exception("Error for appID $appID: ${e.message}")
14+
}
15+
}
16+
}

templates/scala/guides/search/saveObjectsMCM.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import algoliasearch.config.RequestOptions
66

77
def saveObjectsMCM(): Future[Unit] = {
88
val configurations = getAllAppIDConfigurations()
9-
val playlists = Seq(/* Your playlist objects here */)
109
1110
Future.sequence {
1211
configurations.map { case (appID, apiKey) =>

0 commit comments

Comments
 (0)