aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-13 20:10:02 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-13 20:10:02 +0200
commit3fe81fa75eef5320876441539ab89988a04a6c49 (patch)
tree8b27ba4b0c367a15ec82600098516fc8378432e6 /server/middlewares
parentfbf1134e3e6b386c9ec5a3946c61f3faf84397fb (diff)
downloadPeerTube-3fe81fa75eef5320876441539ab89988a04a6c49.tar.gz
PeerTube-3fe81fa75eef5320876441539ab89988a04a6c49.tar.zst
PeerTube-3fe81fa75eef5320876441539ab89988a04a6c49.zip
Move the count of results for the pagination in constants module
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/pagination.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/middlewares/pagination.js b/server/middlewares/pagination.js
index 2a426ec28..9fa43f008 100644
--- a/server/middlewares/pagination.js
+++ b/server/middlewares/pagination.js
@@ -1,5 +1,7 @@
1'use strict' 1'use strict'
2 2
3const constants = require('../initializers/constants')
4
3const paginationMiddleware = { 5const paginationMiddleware = {
4 setPagination: setPagination 6 setPagination: setPagination
5} 7}
@@ -7,7 +9,7 @@ const paginationMiddleware = {
7function setPagination (req, res, next) { 9function setPagination (req, res, next) {
8 if (!req.query.start) req.query.start = 0 10 if (!req.query.start) req.query.start = 0
9 else req.query.start = parseInt(req.query.start) 11 else req.query.start = parseInt(req.query.start)
10 if (!req.query.count) req.query.count = 15 12 if (!req.query.count) req.query.count = constants.PAGINATION_COUNT_DEFAULT
11 else req.query.count = parseInt(req.query.count) 13 else req.query.count = parseInt(req.query.count)
12 14
13 return next() 15 return next()