aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-07-15 11:17:03 +0200
committerRigel Kent <par@rigelk.eu>2020-07-29 18:15:53 +0200
commitbc99dfe54e093e69ba8fd06d36b36fbbda3f45de (patch)
tree2c13497b77928c2593310746e3ec33333e2b4d66 /server/controllers/api
parent654a188f80fc1f089aa14837084664c908fe27d2 (diff)
downloadPeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.tar.gz
PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.tar.zst
PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.zip
variable columns for users list, more columns possible, badge display for statuses
Diffstat (limited to 'server/controllers/api')
-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}