Skip to content

Commit bad4d2c

Browse files
author
ballinette
committed
1 parent 5a3fee1 commit bad4d2c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Kuzzle.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,9 @@ Kuzzle.prototype.createIndex = function (index, options, cb) {
552552
options = null;
553553
}
554554

555-
this.query({controller: 'index', action: 'create', index: index}, {}, options, typeof cb !== 'function' ? null : cb);
555+
this.query({controller: 'index', action: 'create', index: index}, {}, options, typeof cb !== 'function' ? null : function (err, res) {
556+
cb(err, err ? undefined : res.result);
557+
});
556558

557559
return this;
558560
};

test/kuzzle/methods.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ describe('Kuzzle methods', function () {
832832
should(kuzzle.query).be.calledOnce();
833833
should(kuzzle.query).be.calledWith(expectedQuery, {});
834834
should(cb).be.calledOnce();
835-
should(cb).be.calledWithExactly(null, {result: {acknowledged: true}});
835+
should(cb).be.calledWithExactly(null, {acknowledged: true});
836836
});
837837

838838
it('should execute the callback with an error if an error occurs', function () {

0 commit comments

Comments
 (0)