Skip to content

Commit 2364a58

Browse files
committed
Add settings
1 parent b7ef91f commit 2364a58

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
var executeApiFetch = require ('./apifetch');
3+
var executeApiFetch = require('./apifetch');
4+
var settings = require('./settings');
45

56
var client = function(sitekey) {
67
this.sitekey = sitekey;
@@ -11,7 +12,7 @@ var client = function(sitekey) {
1112
* @param keyword
1213
*/
1314
this.search = function(keyword, cb) {
14-
this.apiFetch('search', keyword, cb);
15+
executeApiFetch(this.sitekey, 'search', keyword, settings.getSettings(), cb);
1516
};
1617

1718

@@ -21,14 +22,14 @@ var client = function(sitekey) {
2122
* @param keyword
2223
*/
2324
this.suggest = function(keyword, cb) {
24-
this.apiFetch('suggest', keyword, cb);
25+
executeApiFetch(this.sitekey, 'suggest', keyword, settings.getSettings(), cb);
2526
};
2627

2728

2829
/**
29-
*
30+
* Public functions
3031
*/
31-
this.apiFetch = executeApiFetch;
32+
this.setLanguage = settings.setLanguage;
3233
}
3334

3435
module.exports = client;

0 commit comments

Comments
 (0)