Skip to content

Commit 50337cc

Browse files
authored
Merge pull request #165 from kuzzleio/hotfix-164-create-index
[HOTFIX] fix #164
2 parents 1ee3e22 + 3b83d38 commit 50337cc

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kuzzle-sdk",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"description": "Official Javascript SDK for Kuzzle",
55
"author": "The Kuzzle Team <[email protected]>",
66
"repository": {

src/kuzzle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ Kuzzle.prototype.createIndex = function (index, options, cb) {
538538
options = null;
539539
}
540540

541-
this.query({controller: 'admin', action: 'createIndex'}, {index: index}, options, typeof cb !== 'function' ? null : cb);
541+
this.query({controller: 'index', action: 'create'}, {index: index}, options, typeof cb !== 'function' ? null : cb);
542542

543543
return this;
544544
};

test/kuzzle/methods.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,8 @@ describe('Kuzzle methods', function () {
896896
should(spy.calledOnce).be.true();
897897
args = spy.firstCall.args;
898898

899-
should(args[0].action).be.exactly('createIndex');
899+
should(args[0].controller).be.exactly('index');
900+
should(args[0].action).be.exactly('create');
900901
should(args[1].index).be.exactly(index);
901902
should(args[2]).be.exactly(options);
902903
should(args[3]).be.exactly(cb);
@@ -914,7 +915,8 @@ describe('Kuzzle methods', function () {
914915
should(spy.calledOnce).be.true();
915916
args = spy.firstCall.args;
916917

917-
should(args[0].action).be.exactly('createIndex');
918+
should(args[0].controller).be.exactly('index');
919+
should(args[0].action).be.exactly('create');
918920
should(args[1].index).be.exactly(index);
919921
should(args[2]).be.null();
920922
should(args[3]).be.exactly(cb);

0 commit comments

Comments
 (0)