From c1f7a737cfe174ff1648f269a62540826d0e8089 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 18 Jan 2022 11:25:52 +0100 Subject: Reduce history method names --- client/src/app/+my-library/my-history/my-history.component.ts | 6 +++--- client/src/app/shared/shared-main/users/user-history.service.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.ts index 34efe5558..daabca178 100644 --- a/client/src/app/+my-library/my-history/my-history.component.ts +++ b/client/src/app/+my-library/my-history/my-history.component.ts @@ -95,7 +95,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { getVideosObservable (page: number) { const newPagination = immutableAssign(this.pagination, { currentPage: page }) - return this.userHistoryService.getUserVideosHistory(newPagination, this.search) + return this.userHistoryService.list(newPagination, this.search) .pipe( tap(res => this.pagination.totalItems = res.total) ) @@ -124,7 +124,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { } deleteHistoryElement (video: Video) { - this.userHistoryService.deleteUserVideoHistoryElement(video) + this.userHistoryService.deleteElement(video) .subscribe({ next: () => { this.videos = this.videos.filter(v => v.id !== video.id) @@ -141,7 +141,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { const res = await this.confirmService.confirm(message, title) if (res !== true) return - this.userHistoryService.clearAllUserVideosHistory() + this.userHistoryService.clearAll() .subscribe({ next: () => { this.notifier.success($localize`Videos history deleted`) diff --git a/client/src/app/shared/shared-main/users/user-history.service.ts b/client/src/app/shared/shared-main/users/user-history.service.ts index e28bcdca9..0cfb2d203 100644 --- a/client/src/app/shared/shared-main/users/user-history.service.ts +++ b/client/src/app/shared/shared-main/users/user-history.service.ts @@ -18,7 +18,7 @@ export class UserHistoryService { private videoService: VideoService ) {} - getUserVideosHistory (historyPagination: ComponentPaginationLight, search?: string) { + list (historyPagination: ComponentPaginationLight, search?: string) { const pagination = this.restService.componentToRestPagination(historyPagination) let params = new HttpParams() @@ -34,13 +34,13 @@ export class UserHistoryService { ) } - deleteUserVideoHistoryElement (video: Video) { + deleteElement (video: Video) { return this.authHttp .delete(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/' + video.id) .pipe(catchError(err => this.restExtractor.handleError(err))) } - clearAllUserVideosHistory () { + clearAll () { return this.authHttp .post(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/remove', {}) .pipe( -- cgit v1.2.3