diff --git a/templates/swift/guides/search/saveObjectsPublicUser.mustache b/templates/swift/guides/search/saveObjectsPublicUser.mustache new file mode 100644 index 0000000000..d9c975ebc7 --- /dev/null +++ b/templates/swift/guides/search/saveObjectsPublicUser.mustache @@ -0,0 +1,17 @@ +import Foundation +#if os(Linux) // For linux interop + import FoundationNetworking +#endif + +import Core +{{> snippets/import}} + +func saveObjectsPublicUser() async throws { + do { + {{> snippets/init}} + + {{#dynamicSnippet}}saveObjectsPlaylistsWithUserIDPublic{{/dynamicSnippet}} + } catch { + print(error) + } +} \ No newline at end of file diff --git a/tests/CTS/guides/search.json b/tests/CTS/guides/search.json index 32f18f839d..7ae7001271 100644 --- a/tests/CTS/guides/search.json +++ b/tests/CTS/guides/search.json @@ -46,6 +46,18 @@ "objects": "$var: playlists" } }, + "saveObjectsPlaylistsWithUserIDPublic": { + "method": "saveObjects", + "parameters": { + "indexName": "indexName", + "objects": "$var: playlists" + }, + "requestOptions": { + "headers": { + "X-Algolia-User-ID": "*" + } + } + }, "saveObjectsPlaylistsWithRequestOptions": { "method": "saveObjects", "parameters": {