From 0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Apr 2018 15:10:54 +0200 Subject: Add account view --- client/src/app/shared/video/abstract-video-list.html | 4 ++-- client/src/app/shared/video/abstract-video-list.ts | 1 + client/src/app/shared/video/video.service.ts | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/video') diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/video/abstract-video-list.html index cb04e07b4..690529dcf 100644 --- a/client/src/app/shared/video/abstract-video-list.html +++ b/client/src/app/shared/video/abstract-video-list.html @@ -1,5 +1,5 @@ -
-
+
+
{{ titlePage }}
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index 728c864e9..642a85f65 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts @@ -29,6 +29,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { syndicationItems = [] loadOnInit = true + marginContent = true pageHeight: number videoWidth: number videoHeight: number diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index ef8babd55..f82aa7389 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts @@ -21,6 +21,8 @@ import { VideoDetails } from './video-details.model' import { VideoEdit } from './video-edit.model' import { Video } from './video.model' import { objectToFormData } from '@app/shared/misc/utils' +import { Account } from '@app/shared/account/account.model' +import { AccountService } from '@app/shared/account/account.service' @Injectable() export class VideoService { @@ -97,6 +99,22 @@ export class VideoService { .catch((res) => this.restExtractor.handleError(res)) } + getAccountVideos ( + account: Account, + videoPagination: ComponentPagination, + sort: VideoSortField + ): Observable<{ videos: Video[], totalVideos: number}> { + const pagination = this.restService.componentPaginationToRestPagination(videoPagination) + + let params = new HttpParams() + params = this.restService.addRestGetParams(params, pagination, sort) + + return this.authHttp + .get(AccountService.BASE_ACCOUNT_URL + account.id + '/videos', { params }) + .map(this.extractVideos) + .catch((res) => this.restExtractor.handleError(res)) + } + getVideos ( videoPagination: ComponentPagination, sort: VideoSortField, -- cgit v1.2.3