diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-18 11:25:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-18 11:25:52 +0100 |
commit | c1f7a737cfe174ff1648f269a62540826d0e8089 (patch) | |
tree | 5a066b12ee24608b25640e74085e575fd0486de4 /client/src | |
parent | 7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180 (diff) | |
download | PeerTube-c1f7a737cfe174ff1648f269a62540826d0e8089.tar.gz PeerTube-c1f7a737cfe174ff1648f269a62540826d0e8089.tar.zst PeerTube-c1f7a737cfe174ff1648f269a62540826d0e8089.zip |
Reduce history method names
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/+my-library/my-history/my-history.component.ts | 6 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/users/user-history.service.ts | 6 |
2 files changed, 6 insertions, 6 deletions
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 { | |||
95 | getVideosObservable (page: number) { | 95 | getVideosObservable (page: number) { |
96 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 96 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
97 | 97 | ||
98 | return this.userHistoryService.getUserVideosHistory(newPagination, this.search) | 98 | return this.userHistoryService.list(newPagination, this.search) |
99 | .pipe( | 99 | .pipe( |
100 | tap(res => this.pagination.totalItems = res.total) | 100 | tap(res => this.pagination.totalItems = res.total) |
101 | ) | 101 | ) |
@@ -124,7 +124,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { | |||
124 | } | 124 | } |
125 | 125 | ||
126 | deleteHistoryElement (video: Video) { | 126 | deleteHistoryElement (video: Video) { |
127 | this.userHistoryService.deleteUserVideoHistoryElement(video) | 127 | this.userHistoryService.deleteElement(video) |
128 | .subscribe({ | 128 | .subscribe({ |
129 | next: () => { | 129 | next: () => { |
130 | this.videos = this.videos.filter(v => v.id !== video.id) | 130 | this.videos = this.videos.filter(v => v.id !== video.id) |
@@ -141,7 +141,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { | |||
141 | const res = await this.confirmService.confirm(message, title) | 141 | const res = await this.confirmService.confirm(message, title) |
142 | if (res !== true) return | 142 | if (res !== true) return |
143 | 143 | ||
144 | this.userHistoryService.clearAllUserVideosHistory() | 144 | this.userHistoryService.clearAll() |
145 | .subscribe({ | 145 | .subscribe({ |
146 | next: () => { | 146 | next: () => { |
147 | this.notifier.success($localize`Videos history deleted`) | 147 | 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 { | |||
18 | private videoService: VideoService | 18 | private videoService: VideoService |
19 | ) {} | 19 | ) {} |
20 | 20 | ||
21 | getUserVideosHistory (historyPagination: ComponentPaginationLight, search?: string) { | 21 | list (historyPagination: ComponentPaginationLight, search?: string) { |
22 | const pagination = this.restService.componentToRestPagination(historyPagination) | 22 | const pagination = this.restService.componentToRestPagination(historyPagination) |
23 | 23 | ||
24 | let params = new HttpParams() | 24 | let params = new HttpParams() |
@@ -34,13 +34,13 @@ export class UserHistoryService { | |||
34 | ) | 34 | ) |
35 | } | 35 | } |
36 | 36 | ||
37 | deleteUserVideoHistoryElement (video: Video) { | 37 | deleteElement (video: Video) { |
38 | return this.authHttp | 38 | return this.authHttp |
39 | .delete(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/' + video.id) | 39 | .delete(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/' + video.id) |
40 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 40 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
41 | } | 41 | } |
42 | 42 | ||
43 | clearAllUserVideosHistory () { | 43 | clearAll () { |
44 | return this.authHttp | 44 | return this.authHttp |
45 | .post(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/remove', {}) | 45 | .post(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/remove', {}) |
46 | .pipe( | 46 | .pipe( |