Skip to content

Commit d322401

Browse files
authored
Merge pull request icebob#113 from jossef/patch-1
master <- fixed limit/offset type bug
2 parents 38f1c3e + 7ce5fea commit d322401

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

server/core/context.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,15 @@ class Context {
572572
*/
573573
queryPageSort(query) {
574574
if (this.params) {
575-
if (this.params.limit)
576-
query.limit(this.params.limit);
575+
if (this.params.limit) {
576+
let limit = parseInt(this.params.limit);
577+
query.limit(limit);
578+
}
577579

578-
if (this.params.offset)
579-
query.skip(this.params.offset);
580+
if (this.params.offset) {
581+
let offset = parseInt(this.params.offset);
582+
query.skip(offset);
583+
}
580584

581585
if (this.params.sort)
582586
query.sort(this.params.sort.replace(/,/, " "));

0 commit comments

Comments
 (0)