aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/pagination.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/pagination.js')
-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()