diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-15 11:17:03 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-07-29 18:15:53 +0200 |
commit | bc99dfe54e093e69ba8fd06d36b36fbbda3f45de (patch) | |
tree | 2c13497b77928c2593310746e3ec33333e2b4d66 /server/controllers/api/video-channel.ts | |
parent | 654a188f80fc1f089aa14837084664c908fe27d2 (diff) | |
download | PeerTube-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/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 11 |
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' |
18 | import { VideoChannelModel } from '../../models/video/video-channel' | 18 | import { VideoChannelModel } from '../../models/video/video-channel' |
19 | import { videoChannelsNameWithHostValidator, videosSortValidator } from '../../middlewares/validators' | 19 | import { videoChannelsNameWithHostValidator, videosSortValidator, videoChannelsOwnSearchValidator } from '../../middlewares/validators' |
20 | import { sendUpdateActor } from '../../lib/activitypub/send' | 20 | import { sendUpdateActor } from '../../lib/activitypub/send' |
21 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' | 21 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' |
22 | import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' | 22 | import { 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 | ||
115 | async function listVideoChannels (req: express.Request, res: express.Response) { | 116 | async 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 | } |