From 747c562837e37f2fa455e8ef62165e9bb4e365f1 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 24 Mar 2020 01:12:30 +0100 Subject: Put channel stats behind withStats flag --- server/controllers/api/accounts.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts index f354ccf24..f8d2bad8b 100644 --- a/server/controllers/api/accounts.ts +++ b/server/controllers/api/accounts.ts @@ -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) -- cgit v1.2.3