diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/middlewares/pagination.ts | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip |
Type models
Diffstat (limited to 'server/middlewares/pagination.ts')
-rw-r--r-- | server/middlewares/pagination.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/pagination.ts b/server/middlewares/pagination.ts index 8fe9f9082..cadd76980 100644 --- a/server/middlewares/pagination.ts +++ b/server/middlewares/pagination.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | const constants = require('../initializers/constants') | 1 | import { PAGINATION_COUNT_DEFAULT } from '../initializers' |
2 | 2 | ||
3 | function setPagination (req, res, next) { | 3 | function setPagination (req, res, next) { |
4 | if (!req.query.start) req.query.start = 0 | 4 | if (!req.query.start) req.query.start = 0 |
5 | else req.query.start = parseInt(req.query.start, 10) | 5 | else req.query.start = parseInt(req.query.start, 10) |
6 | 6 | ||
7 | if (!req.query.count) req.query.count = constants.PAGINATION_COUNT_DEFAULT | 7 | if (!req.query.count) req.query.count = PAGINATION_COUNT_DEFAULT |
8 | else req.query.count = parseInt(req.query.count, 10) | 8 | else req.query.count = parseInt(req.query.count, 10) |
9 | 9 | ||
10 | return next() | 10 | return next() |