aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-01-09 00:43:52 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-01-09 09:21:35 +0100
commitfbc77eb648bda9add4634c08dbb6af48c3670b5d (patch)
treecb2c32e33031490027210cf7e29cc98b519b2f83 /server/controllers
parentc08579e14fe712cb2264a25daea956e682574335 (diff)
downloadPeerTube-fbc77eb648bda9add4634c08dbb6af48c3670b5d.tar.gz
PeerTube-fbc77eb648bda9add4634c08dbb6af48c3670b5d.tar.zst
PeerTube-fbc77eb648bda9add4634c08dbb6af48c3670b5d.zip
Add outbox page size parameter
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/activitypub/outbox.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts
index f3dd2ad7d..916a110a8 100644
--- a/server/controllers/activitypub/outbox.ts
+++ b/server/controllers/activitypub/outbox.ts
@@ -9,15 +9,18 @@ import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } fr
9import { VideoModel } from '../../models/video/video' 9import { VideoModel } from '../../models/video/video'
10import { activityPubResponse } from './utils' 10import { activityPubResponse } from './utils'
11import { MActorLight } from '@server/typings/models' 11import { MActorLight } from '@server/typings/models'
12import { apPaginationValidator } from '../../middlewares/validators/activitypub'
12 13
13const outboxRouter = express.Router() 14const outboxRouter = express.Router()
14 15
15outboxRouter.get('/accounts/:name/outbox', 16outboxRouter.get('/accounts/:name/outbox',
17 apPaginationValidator,
16 localAccountValidator, 18 localAccountValidator,
17 asyncMiddleware(outboxController) 19 asyncMiddleware(outboxController)
18) 20)
19 21
20outboxRouter.get('/video-channels/:name/outbox', 22outboxRouter.get('/video-channels/:name/outbox',
23 apPaginationValidator,
21 localVideoChannelValidator, 24 localVideoChannelValidator,
22 asyncMiddleware(outboxController) 25 asyncMiddleware(outboxController)
23) 26)
@@ -38,7 +41,7 @@ async function outboxController (req: express.Request, res: express.Response) {
38 logger.info('Receiving outbox request for %s.', actorOutboxUrl) 41 logger.info('Receiving outbox request for %s.', actorOutboxUrl)
39 42
40 const handler = (start: number, count: number) => buildActivities(actor, start, count) 43 const handler = (start: number, count: number) => buildActivities(actor, start, count)
41 const json = await activityPubCollectionPagination(actorOutboxUrl, handler, req.query.page) 44 const json = await activityPubCollectionPagination(actorOutboxUrl, handler, req.query.page, req.query.size)
42 45
43 return activityPubResponse(activityPubContextify(json), res) 46 return activityPubResponse(activityPubContextify(json), res)
44} 47}