Adds limit = 0 as a valid parameter for queries (#1493)
* Remove results if limit = 0; * Adds tests for limit=0 and count=1. * Improves readability.
This commit is contained in:
@@ -325,6 +325,10 @@ RestQuery.prototype.replaceDontSelect = function() {
|
||||
// Returns a promise for whether it was successful.
|
||||
// Populates this.response with an object that only has 'results'.
|
||||
RestQuery.prototype.runFind = function() {
|
||||
if (this.findOptions.limit === 0) {
|
||||
this.response = {results: []};
|
||||
return Promise.resolve();
|
||||
}
|
||||
return this.config.database.find(
|
||||
this.className, this.restWhere, this.findOptions).then((results) => {
|
||||
if (this.className === '_User') {
|
||||
|
||||
Reference in New Issue
Block a user