Skip to content

Commit 224f704

Browse files
author
ballinette
committed
fix #164
1 parent 1ee3e22 commit 224f704

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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)