aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r--server/controllers/api/video-channel.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts
index 4d8cfa340..d96998209 100644
--- a/server/controllers/api/video-channel.ts
+++ b/server/controllers/api/video-channel.ts
@@ -16,7 +16,7 @@ import {
16 videoPlaylistsSortValidator 16 videoPlaylistsSortValidator
17} from '../../middlewares' 17} from '../../middlewares'
18import { VideoChannelModel } from '../../models/video/video-channel' 18import { VideoChannelModel } from '../../models/video/video-channel'
19import { videoChannelsNameWithHostValidator, videosSortValidator } from '../../middlewares/validators' 19import { videoChannelsNameWithHostValidator, videosSortValidator, videoChannelsOwnSearchValidator } from '../../middlewares/validators'
20import { sendUpdateActor } from '../../lib/activitypub/send' 20import { sendUpdateActor } from '../../lib/activitypub/send'
21import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' 21import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared'
22import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' 22import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel'
@@ -48,6 +48,7 @@ videoChannelRouter.get('/',
48 videoChannelsSortValidator, 48 videoChannelsSortValidator,
49 setDefaultSort, 49 setDefaultSort,
50 setDefaultPagination, 50 setDefaultPagination,
51 videoChannelsOwnSearchValidator,
51 asyncMiddleware(listVideoChannels) 52 asyncMiddleware(listVideoChannels)
52) 53)
53 54
@@ -114,7 +115,13 @@ export {
114 115
115async function listVideoChannels (req: express.Request, res: express.Response) { 116async function listVideoChannels (req: express.Request, res: express.Response) {
116 const serverActor = await getServerActor() 117 const serverActor = await getServerActor()
117 const resultList = await VideoChannelModel.listForApi(serverActor.id, req.query.start, req.query.count, req.query.sort) 118 const resultList = await VideoChannelModel.listForApi({
119 actorId: serverActor.id,
120 start: req.query.start,
121 count: req.query.count,
122 sort: req.query.sort,
123 search: req.query.search
124 })
118 125
119 return res.json(getFormattedObjects(resultList.data, resultList.total)) 126 return res.json(getFormattedObjects(resultList.data, resultList.total))
120} 127}