Skip to content

Commit

Permalink
fix: limit open
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Mar 16, 2022
1 parent 48e7e17 commit 3ad0d67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions __tests__/api-tests/earnings-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,11 @@ describe('Earnings API tests.', () => {
});
});

it(`Should raise validation error with error code 422 -- 'limit' query parameter should be less than 101 `, function (done) {
it(`Should raise validation error with error code 422 -- 'limit' query parameter should be less than 1000000 `, function (done) {
request(server)
.get(`/earnings`)
.query({
limit: 101,
limit: 1000000+1,
})
.set('Accept', 'application/json')
.set('Authorization', jwtToken)
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/earningsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const earningsGetQuerySchema = Joi.object({
contract_id: Joi.string().uuid(),
start_date: Joi.date().iso(),
end_date: Joi.date().iso(),
limit: Joi.number().integer().greater(0).less(101),
limit: Joi.number().integer().greater(0).less(100000),
offset: Joi.number().integer().greater(-1),
sort_by: Joi.string().valid(
'id',
Expand Down

0 comments on commit 3ad0d67

Please sign in to comment.