From 7e7d8e485356402e7652c61c9f004e850b0a1607 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 2 Nov 2021 11:00:40 +0100 Subject: Some fixes for admin videos list --- client/src/app/shared/shared-main/video/video.service.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'client/src/app/shared') 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 5db9a8704..819847ac6 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -48,7 +48,7 @@ export type CommonVideoParams = { @Injectable() export class VideoService { - static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' + static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos' static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.' @@ -60,18 +60,18 @@ export class VideoService { ) {} getVideoViewUrl (uuid: string) { - return VideoService.BASE_VIDEO_URL + uuid + '/views' + return VideoService.BASE_VIDEO_URL + '/' + uuid + '/views' } getUserWatchingVideoUrl (uuid: string) { - return VideoService.BASE_VIDEO_URL + uuid + '/watching' + return VideoService.BASE_VIDEO_URL + '/' + uuid + '/watching' } getVideo (options: { videoId: string }): Observable { return this.serverService.getServerLocale() .pipe( switchMap(translations => { - return this.authHttp.get(VideoService.BASE_VIDEO_URL + options.videoId) + return this.authHttp.get(VideoService.BASE_VIDEO_URL + '/' + options.videoId) .pipe(map(videoHash => ({ videoHash, translations }))) }), map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), @@ -111,7 +111,7 @@ export class VideoService { const data = objectToFormData(body) - return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) + return this.authHttp.put(VideoService.BASE_VIDEO_URL + '/' + video.id, data) .pipe( map(this.restExtractor.extractDataBool), catchError(err => this.restExtractor.handleError(err)) @@ -119,7 +119,7 @@ export class VideoService { } uploadVideo (video: FormData) { - const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + 'upload', video, { reportProgress: true }) + const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + '/' + 'upload', video, { reportProgress: true }) return this.authHttp .request<{ video: { id: number, uuid: string } }>(req) @@ -321,7 +321,7 @@ export class VideoService { return from(ids) .pipe( - concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + id)), + concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id)), toArray(), catchError(err => this.restExtractor.handleError(err)) ) @@ -413,7 +413,7 @@ export class VideoService { } private setVideoRate (id: number, rateType: UserVideoRateType) { - const url = VideoService.BASE_VIDEO_URL + id + '/rate' + const url = VideoService.BASE_VIDEO_URL + '/' + id + '/rate' const body: UserVideoRateUpdate = { rating: rateType } -- cgit v1.2.3