diff options
Diffstat (limited to 'client/src/app/shared/shared-main/video')
3 files changed, 8 insertions, 29 deletions
diff --git a/client/src/app/shared/shared-main/video/redundancy.service.ts b/client/src/app/shared/shared-main/video/redundancy.service.ts index 966d7fafd..4377d628a 100644 --- a/client/src/app/shared/shared-main/video/redundancy.service.ts +++ b/client/src/app/shared/shared-main/video/redundancy.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { concat, Observable } from 'rxjs' | 2 | import { concat, Observable } from 'rxjs' |
3 | import { catchError, map, toArray } from 'rxjs/operators' | 3 | import { catchError, toArray } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
@@ -23,10 +23,7 @@ export class RedundancyService { | |||
23 | const body = { redundancyAllowed } | 23 | const body = { redundancyAllowed } |
24 | 24 | ||
25 | return this.authHttp.put(url, body) | 25 | return this.authHttp.put(url, body) |
26 | .pipe( | 26 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
27 | map(this.restExtractor.extractDataBool), | ||
28 | catchError(err => this.restExtractor.handleError(err)) | ||
29 | ) | ||
30 | } | 27 | } |
31 | 28 | ||
32 | listVideoRedundancies (options: { | 29 | listVideoRedundancies (options: { |
@@ -65,9 +62,6 @@ export class RedundancyService { | |||
65 | 62 | ||
66 | private removeRedundancy (redundancyId: number) { | 63 | private removeRedundancy (redundancyId: number) { |
67 | return this.authHttp.delete(RedundancyService.BASE_REDUNDANCY_URL + '/videos/' + redundancyId) | 64 | return this.authHttp.delete(RedundancyService.BASE_REDUNDANCY_URL + '/videos/' + redundancyId) |
68 | .pipe( | 65 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
69 | map(this.restExtractor.extractDataBool), | ||
70 | catchError(res => this.restExtractor.handleError(res)) | ||
71 | ) | ||
72 | } | 66 | } |
73 | } | 67 | } |
diff --git a/client/src/app/shared/shared-main/video/video-ownership.service.ts b/client/src/app/shared/shared-main/video/video-ownership.service.ts index 273930a6c..bc0e1b1d1 100644 --- a/client/src/app/shared/shared-main/video/video-ownership.service.ts +++ b/client/src/app/shared/shared-main/video/video-ownership.service.ts | |||
@@ -25,10 +25,7 @@ export class VideoOwnershipService { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | return this.authHttp.post(url, body) | 27 | return this.authHttp.post(url, body) |
28 | .pipe( | 28 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
29 | map(this.restExtractor.extractDataBool), | ||
30 | catchError(res => this.restExtractor.handleError(res)) | ||
31 | ) | ||
32 | } | 29 | } |
33 | 30 | ||
34 | getOwnershipChanges (pagination: RestPagination, sort: SortMeta): Observable<ResultList<VideoChangeOwnership>> { | 31 | getOwnershipChanges (pagination: RestPagination, sort: SortMeta): Observable<ResultList<VideoChangeOwnership>> { |
@@ -47,18 +44,12 @@ export class VideoOwnershipService { | |||
47 | acceptOwnership (id: number, input: VideoChangeOwnershipAccept) { | 44 | acceptOwnership (id: number, input: VideoChangeOwnershipAccept) { |
48 | const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + 'ownership/' + id + '/accept' | 45 | const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + 'ownership/' + id + '/accept' |
49 | return this.authHttp.post(url, input) | 46 | return this.authHttp.post(url, input) |
50 | .pipe( | 47 | .pipe(catchError(this.restExtractor.handleError)) |
51 | map(this.restExtractor.extractDataBool), | ||
52 | catchError(this.restExtractor.handleError) | ||
53 | ) | ||
54 | } | 48 | } |
55 | 49 | ||
56 | refuseOwnership (id: number) { | 50 | refuseOwnership (id: number) { |
57 | const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + 'ownership/' + id + '/refuse' | 51 | const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + 'ownership/' + id + '/refuse' |
58 | return this.authHttp.post(url, {}) | 52 | return this.authHttp.post(url, {}) |
59 | .pipe( | 53 | .pipe(catchError(this.restExtractor.handleError)) |
60 | map(this.restExtractor.extractDataBool), | ||
61 | catchError(this.restExtractor.handleError) | ||
62 | ) | ||
63 | } | 54 | } |
64 | } | 55 | } |
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 9bfa397f8..94af9cd38 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -114,10 +114,7 @@ export class VideoService { | |||
114 | const data = objectToFormData(body) | 114 | const data = objectToFormData(body) |
115 | 115 | ||
116 | return this.authHttp.put(`${VideoService.BASE_VIDEO_URL}/${video.id}`, data) | 116 | return this.authHttp.put(`${VideoService.BASE_VIDEO_URL}/${video.id}`, data) |
117 | .pipe( | 117 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
118 | map(this.restExtractor.extractDataBool), | ||
119 | catchError(err => this.restExtractor.handleError(err)) | ||
120 | ) | ||
121 | } | 118 | } |
122 | 119 | ||
123 | uploadVideo (video: FormData) { | 120 | uploadVideo (video: FormData) { |
@@ -449,9 +446,6 @@ export class VideoService { | |||
449 | 446 | ||
450 | return this.authHttp | 447 | return this.authHttp |
451 | .put(url, body) | 448 | .put(url, body) |
452 | .pipe( | 449 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
453 | map(this.restExtractor.extractDataBool), | ||
454 | catchError(err => this.restExtractor.handleError(err)) | ||
455 | ) | ||
456 | } | 450 | } |
457 | } | 451 | } |