From 92e66e04f7f51d37b465cff442ce47f6d6d7cadd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 22 Mar 2022 16:58:49 +0100 Subject: Rename studio to editor --- .../+video-studio/shared/video-studio.service.ts | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 client/src/app/+video-studio/shared/video-studio.service.ts (limited to 'client/src/app/+video-studio/shared/video-studio.service.ts') diff --git a/client/src/app/+video-studio/shared/video-studio.service.ts b/client/src/app/+video-studio/shared/video-studio.service.ts new file mode 100644 index 000000000..8d8b2f0e5 --- /dev/null +++ b/client/src/app/+video-studio/shared/video-studio.service.ts @@ -0,0 +1,28 @@ +import { catchError } from 'rxjs' +import { HttpClient } from '@angular/common/http' +import { Injectable } from '@angular/core' +import { RestExtractor } from '@app/core' +import { objectToFormData } from '@app/helpers' +import { VideoService } from '@app/shared/shared-main' +import { VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' + +@Injectable() +export class VideoStudioService { + + constructor ( + private authHttp: HttpClient, + private restExtractor: RestExtractor + ) {} + + editVideo (videoId: number | string, tasks: VideoStudioTask[]) { + const url = VideoService.BASE_VIDEO_URL + '/' + videoId + '/studio/edit' + const body: VideoStudioCreateEdition = { + tasks + } + + const data = objectToFormData(body) + + return this.authHttp.post(url, data) + .pipe(catchError(err => this.restExtractor.handleError(err))) + } +} -- cgit v1.2.3