Reduce history method names
This commit is contained in:
parent
7177b46ca1
commit
c1f7a737cf
|
@ -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`)
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue