Skip to content

Commit 5a5708d

Browse files
committed
Merge branch 'collectionsOperations' of github.com:kuzzleio/sdk-javascript into collectionsOperations
2 parents 915d8ce + 11cbcf5 commit 5a5708d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/kuzzleDocument.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,15 @@ KuzzleDocument.prototype.refresh = function (options, cb) {
237237
KuzzleDocument.prototype.save = function (options, cb) {
238238
var
239239
data = this.toJSON(),
240-
self = this;
241-
var queryCB = function (error, result) {
240+
self = this,
241+
queryCB;
242+
243+
if (options && cb === undefined && typeof options === 'function') {
244+
cb = options;
245+
options = null;
246+
}
247+
248+
queryCB = function (error, result) {
242249
if (error) {
243250
return cb ? cb(error) : false;
244251
}

tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
Test are done on examples directories.
3-
You must overrid the current Kuzzle instance for all the examples (http://localhost:7512 is used)
3+
You must override the current Kuzzle instance for all the examples (http://localhost:7512 is used)
44

55
You must launch
66
java -jar selenium-server-standalone-2.46.0.jar
77

88

99
You must launch
10-
mocha test/testWebdriverIO.js
10+
mocha test/testWebdriverIO.js

0 commit comments

Comments
 (0)