) {}
getUserVideosHistory (historyPagination: ComponentPaginationLight, search?: string) {
- const pagination = this.restService.componentPaginationToRestPagination(historyPagination)
+ const pagination = this.restService.componentToRestPagination(historyPagination)
let params = new HttpParams()
params = this.restService.addRestGetParams(params, pagination)
- params = params.append('search', search)
+
+ if (search) params = params.append('search', search)
return this.authHttp
.get<ResultList<Video>>(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL, { params })
)
}
- deleteUserVideosHistory () {
+ deleteUserVideoHistoryElement (video: Video) {
+ return this.authHttp
+ .delete(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/' + video.id)
+ .pipe(catchError(err => this.restExtractor.handleError(err)))
+ }
+
+ clearAllUserVideosHistory () {
return this.authHttp
.post(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/remove', {})
.pipe(