Skip to content

Commit a86ff38

Browse files
committed
Allow sending 'offset' and 'limit' params as strings. Fixes #22
1 parent 302246d commit a86ff38

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ function filterQuery(resourceConfig, params) {
142142
}
143143

144144
if (params.skip) {
145-
query = query.offset(params.offset);
145+
query = query.offset(+params.offset);
146146
}
147147

148148
if (params.limit) {
149-
query = query.limit(params.limit);
149+
query = query.limit(+params.limit);
150150
}
151151

152152
return query;

test/findAll.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ describe('DSSqlAdapter#findAll', function () {
168168
assert.equal(comments[0].content, 'test1');
169169
});
170170

171-
171+
it('should allow passing limit and offset as strings', function* () {
172+
var user = yield adapter.findAll(User, {limit: '10', offset: '20'});
173+
});
172174

173175
});

0 commit comments

Comments
 (0)