diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-10 09:31:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-10 09:38:11 +0200 |
commit | dc2b2938c293bae271a27a6c823f66496998b4d3 (patch) | |
tree | 5952837923f46f31684dfee68688091eb112938d /client/src/app/shared/shared-main/video-channel/video-channel.service.ts | |
parent | e024fd6a7494b37251da1d59470324305cdb4129 (diff) | |
download | PeerTube-dc2b2938c293bae271a27a6c823f66496998b4d3.tar.gz PeerTube-dc2b2938c293bae271a27a6c823f66496998b4d3.tar.zst PeerTube-dc2b2938c293bae271a27a6c823f66496998b4d3.zip |
Sort channels by -updatedAt
Diffstat (limited to 'client/src/app/shared/shared-main/video-channel/video-channel.service.ts')
-rw-r--r-- | client/src/app/shared/shared-main/video-channel/video-channel.service.ts | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts index e65261763..a89f1065a 100644 --- a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts | |||
@@ -40,23 +40,24 @@ export class VideoChannelService { | |||
40 | ) | 40 | ) |
41 | } | 41 | } |
42 | 42 | ||
43 | listAccountVideoChannels ( | 43 | listAccountVideoChannels (options: { |
44 | account: Account, | 44 | account: Account |
45 | componentPagination?: ComponentPaginationLight, | 45 | componentPagination?: ComponentPaginationLight |
46 | withStats = false, | 46 | withStats?: boolean |
47 | sort?: string | ||
47 | search?: string | 48 | search?: string |
48 | ): Observable<ResultList<VideoChannel>> { | 49 | }): Observable<ResultList<VideoChannel>> { |
50 | const { account, componentPagination, withStats = false, sort, search } = options | ||
51 | |||
49 | const pagination = componentPagination | 52 | const pagination = componentPagination |
50 | ? this.restService.componentPaginationToRestPagination(componentPagination) | 53 | ? this.restService.componentPaginationToRestPagination(componentPagination) |
51 | : { start: 0, count: 20 } | 54 | : { start: 0, count: 20 } |
52 | 55 | ||
53 | let params = new HttpParams() | 56 | let params = new HttpParams() |
54 | params = this.restService.addRestGetParams(params, pagination) | 57 | params = this.restService.addRestGetParams(params, pagination, sort) |
55 | params = params.set('withStats', withStats + '') | 58 | params = params.set('withStats', withStats + '') |
56 | 59 | ||
57 | if (search) { | 60 | if (search) params = params.set('search', search) |
58 | params = params.set('search', search) | ||
59 | } | ||
60 | 61 | ||
61 | const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-channels' | 62 | const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-channels' |
62 | return this.authHttp.get<ResultList<VideoChannelServer>>(url, { params }) | 63 | return this.authHttp.get<ResultList<VideoChannelServer>>(url, { params }) |