Put channel stats behind withStats flag
[oweals/peertube.git] / client / src / app / shared / video-channel / video-channel.service.ts
index adb4f48192e426c3dfb9c428e4cd1489d13d3dd6..0e036bda766b4da49066339d9c43a5ff49039055 100644 (file)
@@ -44,13 +44,18 @@ export class VideoChannelService {
                )
   }
 
-  listAccountVideoChannels (account: Account, componentPagination?: ComponentPaginationLight): Observable<ResultList<VideoChannel>> {
+  listAccountVideoChannels (
+    account: Account,
+    componentPagination?: ComponentPaginationLight,
+    withStats = false
+  ): Observable<ResultList<VideoChannel>> {
     const pagination = componentPagination
       ? this.restService.componentPaginationToRestPagination(componentPagination)
       : { start: 0, count: 20 }
 
     let params = new HttpParams()
     params = this.restService.addRestGetParams(params, pagination)
+    params = params.set('withStats', withStats + '')
 
     const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-channels'
     return this.authHttp.get<ResultList<VideoChannelServer>>(url, { params })