Skip to content

Commit 4c21c47

Browse files
committed
Pass API hostname to indexing functions
1 parent 26af325 commit 4c21c47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,29 +99,29 @@ var client = function(sitekey, privatekey) {
9999
* Indexing API functions
100100
*/
101101
this.getDocument = function(id) {
102-
return indexingapi.getDocument(this.sitekey, this.privatekey, id);
102+
return indexingapi.getDocument(this.apiHostname, this.sitekey, this.privatekey, id);
103103
}
104104

105105
this.saveDocument = function(document) {
106-
return indexingapi.saveDocument(this.sitekey, this.privatekey, document);
106+
return indexingapi.saveDocument(this.apiHostname, this.sitekey, this.privatekey, document);
107107
}
108108

109109
this.saveDocumentsBatch = function(batch) {
110110
if (!batch || !batch.documents || !Array.isArray(batch.documents)) {
111111
throw "Please provide an array of documents: {documents: []}";
112112
}
113-
return indexingapi.saveDocumentsBatch(this.sitekey, this.privatekey, batch);
113+
return indexingapi.saveDocumentsBatch(this.apiHostname, this.sitekey, this.privatekey, batch);
114114
}
115115

116116
this.deleteDocument = function(id) {
117-
return indexingapi.deleteDocument(this.sitekey, this.privatekey, id);
117+
return indexingapi.deleteDocument(this.apiHostname, this.sitekey, this.privatekey, id);
118118
}
119119

120120
this.deleteDocumentsBatch = function(batch) {
121121
if (!batch || !batch.documents || !Array.isArray(batch.documents)) {
122122
throw "Please provide an array of document ids: {documents: []}";
123123
}
124-
return indexingapi.deleteDocumentsBatch(this.sitekey, this.privatekey, batch);
124+
return indexingapi.deleteDocumentsBatch(this.apiHostname, this.sitekey, this.privatekey, batch);
125125
}
126126

127127

0 commit comments

Comments
 (0)