aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/shared/users/user.service.ts12
-rw-r--r--client/src/app/shared/video-channel/video-channel.service.ts6
-rw-r--r--client/src/app/shared/video/video.service.ts26
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.service.ts12
4 files changed, 28 insertions, 28 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index 9fe6c8b60..365a21df7 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -25,7 +25,7 @@ export class UserService {
25 return this.authHttp.put(url, body) 25 return this.authHttp.put(url, body)
26 .pipe( 26 .pipe(
27 map(this.restExtractor.extractDataBool), 27 map(this.restExtractor.extractDataBool),
28 catchError(res => this.restExtractor.handleError(res)) 28 catchError(err => this.restExtractor.handleError(err))
29 ) 29 )
30 } 30 }
31 31
@@ -35,7 +35,7 @@ export class UserService {
35 return this.authHttp.put(url, profile) 35 return this.authHttp.put(url, profile)
36 .pipe( 36 .pipe(
37 map(this.restExtractor.extractDataBool), 37 map(this.restExtractor.extractDataBool),
38 catchError(res => this.restExtractor.handleError(res)) 38 catchError(err => this.restExtractor.handleError(err))
39 ) 39 )
40 } 40 }
41 41
@@ -43,14 +43,14 @@ export class UserService {
43 const url = UserService.BASE_USERS_URL + 'me/avatar/pick' 43 const url = UserService.BASE_USERS_URL + 'me/avatar/pick'
44 44
45 return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm) 45 return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm)
46 .pipe(catchError(this.restExtractor.handleError)) 46 .pipe(catchError(err => this.restExtractor.handleError(err)))
47 } 47 }
48 48
49 signup (userCreate: UserCreate) { 49 signup (userCreate: UserCreate) {
50 return this.authHttp.post(UserService.BASE_USERS_URL + 'register', userCreate) 50 return this.authHttp.post(UserService.BASE_USERS_URL + 'register', userCreate)
51 .pipe( 51 .pipe(
52 map(this.restExtractor.extractDataBool), 52 map(this.restExtractor.extractDataBool),
53 catchError(res => this.restExtractor.handleError(res)) 53 catchError(err => this.restExtractor.handleError(err))
54 ) 54 )
55 } 55 }
56 56
@@ -58,7 +58,7 @@ export class UserService {
58 const url = UserService.BASE_USERS_URL + '/me/video-quota-used' 58 const url = UserService.BASE_USERS_URL + '/me/video-quota-used'
59 59
60 return this.authHttp.get<UserVideoQuota>(url) 60 return this.authHttp.get<UserVideoQuota>(url)
61 .pipe(catchError(res => this.restExtractor.handleError(res))) 61 .pipe(catchError(err => this.restExtractor.handleError(err)))
62 } 62 }
63 63
64 askResetPassword (email: string) { 64 askResetPassword (email: string) {
@@ -67,7 +67,7 @@ export class UserService {
67 return this.authHttp.post(url, { email }) 67 return this.authHttp.post(url, { email })
68 .pipe( 68 .pipe(
69 map(this.restExtractor.extractDataBool), 69 map(this.restExtractor.extractDataBool),
70 catchError(res => this.restExtractor.handleError(res)) 70 catchError(err => this.restExtractor.handleError(err))
71 ) 71 )
72 } 72 }
73 73
diff --git a/client/src/app/shared/video-channel/video-channel.service.ts b/client/src/app/shared/video-channel/video-channel.service.ts
index 0b9900208..8c000665f 100644
--- a/client/src/app/shared/video-channel/video-channel.service.ts
+++ b/client/src/app/shared/video-channel/video-channel.service.ts
@@ -27,7 +27,7 @@ export class VideoChannelService {
27 .pipe( 27 .pipe(
28 map(videoChannelHash => new VideoChannel(videoChannelHash)), 28 map(videoChannelHash => new VideoChannel(videoChannelHash)),
29 tap(videoChannel => this.videoChannelLoaded.next(videoChannel)), 29 tap(videoChannel => this.videoChannelLoaded.next(videoChannel)),
30 catchError(res => this.restExtractor.handleError(res)) 30 catchError(err => this.restExtractor.handleError(err))
31 ) 31 )
32 } 32 }
33 33
@@ -35,7 +35,7 @@ export class VideoChannelService {
35 return this.authHttp.get<ResultList<VideoChannelServer>>(AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-channels') 35 return this.authHttp.get<ResultList<VideoChannelServer>>(AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-channels')
36 .pipe( 36 .pipe(
37 map(res => this.extractVideoChannels(res)), 37 map(res => this.extractVideoChannels(res)),
38 catchError((res) => this.restExtractor.handleError(res)) 38 catchError(err => this.restExtractor.handleError(err))
39 ) 39 )
40 } 40 }
41 41
@@ -59,7 +59,7 @@ export class VideoChannelService {
59 const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelUUID + '/avatar/pick' 59 const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelUUID + '/avatar/pick'
60 60
61 return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm) 61 return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm)
62 .pipe(catchError(this.restExtractor.handleError)) 62 .pipe(catchError(err => this.restExtractor.handleError(err)))
63 } 63 }
64 64
65 removeVideoChannel (videoChannel: VideoChannel) { 65 removeVideoChannel (videoChannel: VideoChannel) {
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts
index 4783adf42..9498a06fe 100644
--- a/client/src/app/shared/video/video.service.ts
+++ b/client/src/app/shared/video/video.service.ts
@@ -50,7 +50,7 @@ export class VideoService {
50 .pipe(map(videoHash => ({ videoHash, translations }))) 50 .pipe(map(videoHash => ({ videoHash, translations })))
51 }), 51 }),
52 map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), 52 map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)),
53 catchError(res => this.restExtractor.handleError(res)) 53 catchError(err => this.restExtractor.handleError(err))
54 ) 54 )
55 } 55 }
56 56
@@ -58,7 +58,7 @@ export class VideoService {
58 return this.authHttp.post(this.getVideoViewUrl(uuid), {}) 58 return this.authHttp.post(this.getVideoViewUrl(uuid), {})
59 .pipe( 59 .pipe(
60 map(this.restExtractor.extractDataBool), 60 map(this.restExtractor.extractDataBool),
61 catchError(this.restExtractor.handleError) 61 catchError(err => this.restExtractor.handleError(err))
62 ) 62 )
63 } 63 }
64 64
@@ -93,7 +93,7 @@ export class VideoService {
93 return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) 93 return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data)
94 .pipe( 94 .pipe(
95 map(this.restExtractor.extractDataBool), 95 map(this.restExtractor.extractDataBool),
96 catchError(this.restExtractor.handleError) 96 catchError(err => this.restExtractor.handleError(err))
97 ) 97 )
98 } 98 }
99 99
@@ -102,7 +102,7 @@ export class VideoService {
102 102
103 return this.authHttp 103 return this.authHttp
104 .request<{ video: { id: number, uuid: string } }>(req) 104 .request<{ video: { id: number, uuid: string } }>(req)
105 .pipe(catchError(this.restExtractor.handleError)) 105 .pipe(catchError(err => this.restExtractor.handleError(err)))
106 } 106 }
107 107
108 getMyVideos (videoPagination: ComponentPagination, sort: VideoSortField): Observable<{ videos: Video[], totalVideos: number }> { 108 getMyVideos (videoPagination: ComponentPagination, sort: VideoSortField): Observable<{ videos: Video[], totalVideos: number }> {
@@ -115,7 +115,7 @@ export class VideoService {
115 .get<ResultList<Video>>(UserService.BASE_USERS_URL + '/me/videos', { params }) 115 .get<ResultList<Video>>(UserService.BASE_USERS_URL + '/me/videos', { params })
116 .pipe( 116 .pipe(
117 switchMap(res => this.extractVideos(res)), 117 switchMap(res => this.extractVideos(res)),
118 catchError(res => this.restExtractor.handleError(res)) 118 catchError(err => this.restExtractor.handleError(err))
119 ) 119 )
120 } 120 }
121 121
@@ -133,7 +133,7 @@ export class VideoService {
133 .get<ResultList<Video>>(AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/videos', { params }) 133 .get<ResultList<Video>>(AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/videos', { params })
134 .pipe( 134 .pipe(
135 switchMap(res => this.extractVideos(res)), 135 switchMap(res => this.extractVideos(res)),
136 catchError(res => this.restExtractor.handleError(res)) 136 catchError(err => this.restExtractor.handleError(err))
137 ) 137 )
138 } 138 }
139 139
@@ -151,7 +151,7 @@ export class VideoService {
151 .get<ResultList<Video>>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params }) 151 .get<ResultList<Video>>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params })
152 .pipe( 152 .pipe(
153 switchMap(res => this.extractVideos(res)), 153 switchMap(res => this.extractVideos(res)),
154 catchError(res => this.restExtractor.handleError(res)) 154 catchError(err => this.restExtractor.handleError(err))
155 ) 155 )
156 } 156 }
157 157
@@ -178,7 +178,7 @@ export class VideoService {
178 .get<ResultList<Video>>(VideoService.BASE_VIDEO_URL, { params }) 178 .get<ResultList<Video>>(VideoService.BASE_VIDEO_URL, { params })
179 .pipe( 179 .pipe(
180 switchMap(res => this.extractVideos(res)), 180 switchMap(res => this.extractVideos(res)),
181 catchError(res => this.restExtractor.handleError(res)) 181 catchError(err => this.restExtractor.handleError(err))
182 ) 182 )
183 } 183 }
184 184
@@ -248,7 +248,7 @@ export class VideoService {
248 .get<ResultList<VideoServerModel>>(url, { params }) 248 .get<ResultList<VideoServerModel>>(url, { params })
249 .pipe( 249 .pipe(
250 switchMap(res => this.extractVideos(res)), 250 switchMap(res => this.extractVideos(res)),
251 catchError(res => this.restExtractor.handleError(res)) 251 catchError(err => this.restExtractor.handleError(err))
252 ) 252 )
253 } 253 }
254 254
@@ -257,7 +257,7 @@ export class VideoService {
257 .delete(VideoService.BASE_VIDEO_URL + id) 257 .delete(VideoService.BASE_VIDEO_URL + id)
258 .pipe( 258 .pipe(
259 map(this.restExtractor.extractDataBool), 259 map(this.restExtractor.extractDataBool),
260 catchError(res => this.restExtractor.handleError(res)) 260 catchError(err => this.restExtractor.handleError(err))
261 ) 261 )
262 } 262 }
263 263
@@ -266,7 +266,7 @@ export class VideoService {
266 .get(environment.apiUrl + descriptionPath) 266 .get(environment.apiUrl + descriptionPath)
267 .pipe( 267 .pipe(
268 map(res => res[ 'description' ]), 268 map(res => res[ 'description' ]),
269 catchError(res => this.restExtractor.handleError(res)) 269 catchError(err => this.restExtractor.handleError(err))
270 ) 270 )
271 } 271 }
272 272
@@ -286,7 +286,7 @@ export class VideoService {
286 const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating' 286 const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating'
287 287
288 return this.authHttp.get<UserVideoRate>(url) 288 return this.authHttp.get<UserVideoRate>(url)
289 .pipe(catchError(res => this.restExtractor.handleError(res))) 289 .pipe(catchError(err => this.restExtractor.handleError(err)))
290 } 290 }
291 291
292 private setVideoRate (id: number, rateType: VideoRateType) { 292 private setVideoRate (id: number, rateType: VideoRateType) {
@@ -299,7 +299,7 @@ export class VideoService {
299 .put(url, body) 299 .put(url, body)
300 .pipe( 300 .pipe(
301 map(this.restExtractor.extractDataBool), 301 map(this.restExtractor.extractDataBool),
302 catchError(res => this.restExtractor.handleError(res)) 302 catchError(err => this.restExtractor.handleError(err))
303 ) 303 )
304 } 304 }
305 305
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
index 5b9a991a0..73526cb3e 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
@@ -31,8 +31,8 @@ export class VideoCommentService {
31 31
32 return this.authHttp.post(url, normalizedComment) 32 return this.authHttp.post(url, normalizedComment)
33 .pipe( 33 .pipe(
34 map(data => this.extractVideoComment(data['comment'])), 34 map(data => this.extractVideoComment(data['comment'])),
35 catchError(this.restExtractor.handleError) 35 catchError(err => this.restExtractor.handleError(err))
36 ) 36 )
37 } 37 }
38 38
@@ -43,7 +43,7 @@ export class VideoCommentService {
43 return this.authHttp.post(url, normalizedComment) 43 return this.authHttp.post(url, normalizedComment)
44 .pipe( 44 .pipe(
45 map(data => this.extractVideoComment(data[ 'comment' ])), 45 map(data => this.extractVideoComment(data[ 'comment' ])),
46 catchError(this.restExtractor.handleError) 46 catchError(err => this.restExtractor.handleError(err))
47 ) 47 )
48 } 48 }
49 49
@@ -62,7 +62,7 @@ export class VideoCommentService {
62 .get(url, { params }) 62 .get(url, { params })
63 .pipe( 63 .pipe(
64 map(this.extractVideoComments), 64 map(this.extractVideoComments),
65 catchError((res) => this.restExtractor.handleError(res)) 65 catchError(err => this.restExtractor.handleError(err))
66 ) 66 )
67 } 67 }
68 68
@@ -73,7 +73,7 @@ export class VideoCommentService {
73 .get(url) 73 .get(url)
74 .pipe( 74 .pipe(
75 map(tree => this.extractVideoCommentTree(tree as VideoCommentThreadTree)), 75 map(tree => this.extractVideoCommentTree(tree as VideoCommentThreadTree)),
76 catchError((res) => this.restExtractor.handleError(res)) 76 catchError(err => this.restExtractor.handleError(err))
77 ) 77 )
78 } 78 }
79 79
@@ -84,7 +84,7 @@ export class VideoCommentService {
84 .delete(url) 84 .delete(url)
85 .pipe( 85 .pipe(
86 map(this.restExtractor.extractDataBool), 86 map(this.restExtractor.extractDataBool),
87 catchError((res) => this.restExtractor.handleError(res)) 87 catchError(err => this.restExtractor.handleError(err))
88 ) 88 )
89 } 89 }
90 90