ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
616 B

  1. import express from 'express'
  2. import { forceNumber } from '@peertube/peertube-core-utils'
  3. import { PAGINATION } from '../initializers/constants.js'
  4. function setDefaultPagination (req: express.Request, res: express.Response, next: express.NextFunction) {
  5. if (!req.query.start) req.query.start = 0
  6. else req.query.start = forceNumber(req.query.start)
  7. if (!req.query.count) req.query.count = PAGINATION.GLOBAL.COUNT.DEFAULT
  8. else req.query.count = forceNumber(req.query.count)
  9. return next()
  10. }
  11. // ---------------------------------------------------------------------------
  12. export {
  13. setDefaultPagination
  14. }