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

Add ability to search video channels

This commit is contained in:
Chocobozzz 2018-08-23 17:58:39 +02:00
parent 240085d005
commit f37dc0dd14
35 changed files with 670 additions and 145 deletions

View file

@ -1,5 +1,5 @@
import * as express from 'express'
import { getFormattedObjects } from '../../helpers/utils'
import { getFormattedObjects, getServerActor } from '../../helpers/utils'
import {
asyncMiddleware,
asyncRetryTransactionMiddleware,
@ -95,7 +95,8 @@ export {
// ---------------------------------------------------------------------------
async function listVideoChannels (req: express.Request, res: express.Response, next: express.NextFunction) {
const resultList = await VideoChannelModel.listForApi(req.query.start, req.query.count, req.query.sort)
const serverActor = await getServerActor()
const resultList = await VideoChannelModel.listForApi(serverActor.id, req.query.start, req.query.count, req.query.sort)
return res.json(getFormattedObjects(resultList.data, resultList.total))
}