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:
parent
fbf1134e3e
commit
3fe81fa75e
2 changed files with 7 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue