From dc2b2938c293bae271a27a6c823f66496998b4d3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 10 May 2021 09:31:33 +0200 Subject: Sort channels by -updatedAt --- .../account-video-channels/account-video-channels.component.ts | 8 +++++++- client/src/app/+accounts/accounts.component.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'client/src/app/+accounts') diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts index 0628c7a96..7e916e122 100644 --- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts @@ -79,7 +79,13 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { } loadMoreChannels () { - this.videoChannelService.listAccountVideoChannels(this.account, this.channelPagination) + const options = { + account: this.account, + componentPagination: this.channelPagination, + sort: '-updatedAt' + } + + this.videoChannelService.listAccountVideoChannels(options) .pipe( tap(res => this.channelPagination.totalItems = res.total), switchMap(res => from(res.data)), diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index fbd7380a9..c69b04a01 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts @@ -66,7 +66,7 @@ export class AccountsComponent implements OnInit, OnDestroy { distinctUntilChanged(), switchMap(accountId => this.accountService.getAccount(accountId)), tap(account => this.onAccount(account)), - switchMap(account => this.videoChannelService.listAccountVideoChannels(account)), + switchMap(account => this.videoChannelService.listAccountVideoChannels({ account })), catchError(err => this.restExtractor.redirectTo404IfNotFound(err, 'other', [ HttpStatusCode.BAD_REQUEST_400, HttpStatusCode.NOT_FOUND_404 -- cgit v1.2.3