X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fvideo-channel.ts;h=d96998209f6d861f8fc603fc6a788a781b33e6c0;hb=bc99dfe54e093e69ba8fd06d36b36fbbda3f45de;hp=4d8cfa340a4cd991c82701e8813bbca47d90202f;hpb=26d6bf6533023326fa017812cf31bbe20c752d36;p=github%2FChocobozzz%2FPeerTube.git 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 { videoPlaylistsSortValidator } from '../../middlewares' import { VideoChannelModel } from '../../models/video/video-channel' -import { videoChannelsNameWithHostValidator, videosSortValidator } from '../../middlewares/validators' +import { videoChannelsNameWithHostValidator, videosSortValidator, videoChannelsOwnSearchValidator } from '../../middlewares/validators' import { sendUpdateActor } from '../../lib/activitypub/send' import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' @@ -48,6 +48,7 @@ videoChannelRouter.get('/', videoChannelsSortValidator, setDefaultSort, setDefaultPagination, + videoChannelsOwnSearchValidator, asyncMiddleware(listVideoChannels) ) @@ -114,7 +115,13 @@ export { async function listVideoChannels (req: express.Request, res: express.Response) { const serverActor = await getServerActor() - const resultList = await VideoChannelModel.listForApi(serverActor.id, req.query.start, req.query.count, req.query.sort) + const resultList = await VideoChannelModel.listForApi({ + actorId: serverActor.id, + start: req.query.start, + count: req.query.count, + sort: req.query.sort, + search: req.query.search + }) return res.json(getFormattedObjects(resultList.data, resultList.total)) }