import { HttpClient, HttpParams } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
import { HttpClient, HttpParams } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
- getUserVideosHistory (historyPagination: ComponentPaginationLight, search?: string) {
- const pagination = this.restService.componentPaginationToRestPagination(historyPagination)
+ list (historyPagination: ComponentPaginationLight, search?: string) {
+ const pagination = this.restService.componentToRestPagination(historyPagination)
let params = new HttpParams()
params = this.restService.addRestGetParams(params, pagination)
let params = new HttpParams()
params = this.restService.addRestGetParams(params, pagination)
- deleteUserVideosHistory () {
+ deleteElement (video: Video) {
+ return this.authHttp
+ .delete(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/' + video.id)
+ .pipe(catchError(err => this.restExtractor.handleError(err)))
+ }
+
+ clearAll () {