diff --git a/package.json b/package.json index b86a904..7615db6 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "chai": "^3.0.0", "feathers": "^2.0.0-pre.4", "feathers-rest": "^1.3.0", - "feathers-service-tests": "^0.5.3", + "feathers-service-tests": "^0.6.0", "feathers-socketio": "^1.3.3", "jshint": "^2.8.0", "mocha": "^2.5.0", diff --git a/src/index.js b/src/index.js index a17beb8..2f9bdf0 100644 --- a/src/index.js +++ b/src/index.js @@ -69,10 +69,12 @@ class Service { } find(params) { - const paginate = !!this.paginate.default; - const result = this._find(params, paginate, query => filter(query, this.paginate)); + const paginate = (params && typeof params.paginate !== 'undefined') ? + params.paginate : this.paginate; + const result = this._find(params, !!paginate.default, + query => filter(query, paginate)); - if(!paginate) { + if(!paginate.default) { return result.then(page => page.data); }