X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fusers%2Fuser-history.service.ts;h=4cebbc707788419a695fb13781147d338581f2b7;hb=dec437aa46a644fb1b3cedc9afe4503c44e15308;hp=e28bcdca943c1dc31679979ad0c4f4f4b3fda6f8;hpb=7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180;p=github%2FChocobozzz%2FPeerTube.git 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..4cebbc707 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 @@ -1,4 +1,4 @@ -import { catchError, map, switchMap } from 'rxjs/operators' +import { catchError, switchMap } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core' @@ -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,18 +34,15 @@ 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( - map(() => this.restExtractor.extractDataBool()), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } }