File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
templates/swift/guides/search Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import Foundation
2+ #if os(Linux) // For linux interop
3+ import FoundationNetworking
4+ #endif
5+
6+ import Core
7+ { {> snippets/import} }
8+
9+ func setHeaderUserIDThenSaveObjects() async throws {
10+ do {
11+ {{> snippets/init} }
12+
13+ for playlist in playlists {
14+ {{#dynamicSnippet} }saveObjectsPlaylistsWithRequestOptions{ {/dynamicSnippet} }
15+ }
16+ } catch {
17+ print(error)
18+ }
19+ }
Original file line number Diff line number Diff line change 4646 "objects" : " $var: playlists"
4747 }
4848 },
49+ "saveObjectsPlaylistsWithRequestOptions" : {
50+ "method" : " saveObjects" ,
51+ "parameters" : {
52+ "indexName" : " indexName" ,
53+ "objects" : " $var: playlists"
54+ },
55+ "requestOptions" : {
56+ "headers" : {
57+ "X-Algolia-User-ID" : " $var: playlist.userID"
58+ }
59+ }
60+ },
4961 "setSettings" : {
5062 "method" : " setSettings" ,
5163 "parameters" : {
You can’t perform that action at this time.
0 commit comments