Skip to content

Commit 6626f3d

Browse files
committed
Add refresh as option
1 parent 915296c commit 6626f3d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/kuzzle.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,14 +1254,18 @@ Kuzzle.prototype.query = function (queryArgs, query, options, cb) {
12541254

12551255
if (options) {
12561256
if (options.metadata) {
1257+
if (options.queuable === false && self.state === 'offline') {
1258+
return self;
1259+
}
1260+
1261+
if (options.refresh) {
1262+
object.refresh = options.refresh;
1263+
}
1264+
12571265
Object.keys(options.metadata).forEach(function (meta) {
12581266
object.metadata[meta] = options.metadata[meta];
12591267
});
12601268
}
1261-
1262-
if (options.queuable === false && self.state === 'offline') {
1263-
return self;
1264-
}
12651269
}
12661270

12671271
if (!query || typeof query !== 'object' || Array.isArray(query)) {

0 commit comments

Comments
 (0)