Fix issue #5274 on RestQuery.each and relations (#5276)

* Add test on RestQuery.each with relation

* Fix the failing test for RestQuery.each and relations

* Add test for getRolesForUser

* Fix format for comment

* Remove extra fit
This commit is contained in:
Perceval Archimbaud
2019-01-04 20:22:46 +01:00
committed by Florent Vilmart
parent eb877545de
commit 9f2fc88f0f
3 changed files with 110 additions and 8 deletions

View File

@@ -223,7 +223,9 @@ RestQuery.prototype.each = function(callback) {
results.forEach(callback);
finished = results.length < restOptions.limit;
if (!finished) {
restWhere.objectId = { $gt: results[results.length - 1].objectId };
restWhere.objectId = Object.assign({}, restWhere.objectId, {
$gt: results[results.length - 1].objectId,
});
}
}
);