1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Move the count of results for the pagination in constants module

This commit is contained in:
Chocobozzz 2016-05-13 20:10:02 +02:00
parent fbf1134e3e
commit 3fe81fa75e
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,7 @@
'use strict'
const constants = require('../initializers/constants')
const paginationMiddleware = {
setPagination: setPagination
}
@ -7,7 +9,7 @@ const paginationMiddleware = {
function setPagination (req, res, next) {
if (!req.query.start) req.query.start = 0
else req.query.start = parseInt(req.query.start)
if (!req.query.count) req.query.count = 15
if (!req.query.count) req.query.count = constants.PAGINATION_COUNT_DEFAULT
else req.query.count = parseInt(req.query.count)
return next()