]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/accounts.ts
Put channel stats behind withStats flag
[github/Chocobozzz/PeerTube.git] / server / controllers / api / accounts.ts
index f354ccf24e6540b28383015dda1a9c0148a3d81d..f8d2bad8bc79a9ac9363c1f9eeb34cec2ed6ef85 100644 (file)
@@ -17,7 +17,8 @@ import {
   accountsSortValidator,
   ensureAuthUserOwnsAccountValidator,
   videoChannelsSortValidator,
-  videosSortValidator
+  videosSortValidator,
+  videoChannelStatsValidator
 } from '../../middlewares/validators'
 import { AccountModel } from '../../models/account/account'
 import { AccountVideoRateModel } from '../../models/account/account-video-rate'
@@ -56,6 +57,7 @@ accountsRouter.get('/:accountName/videos',
 
 accountsRouter.get('/:accountName/video-channels',
   asyncMiddleware(accountNameWithHostGetValidator),
+  videoChannelStatsValidator,
   paginationValidator,
   videoChannelsSortValidator,
   setDefaultSort,
@@ -116,7 +118,8 @@ async function listAccountChannels (req: express.Request, res: express.Response)
     accountId: res.locals.account.id,
     start: req.query.start,
     count: req.query.count,
-    sort: req.query.sort
+    sort: req.query.sort,
+    withStats: req.query.withStats
   }
 
   const resultList = await VideoChannelModel.listByAccount(options)