diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-22 16:58:49 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-22 17:24:32 +0100 |
commit | 92e66e04f7f51d37b465cff442ce47f6d6d7cadd (patch) | |
tree | 4475c5c601c0f6673ca56afba5b7f70a4fae4ec3 /client/src/app/+video-studio/shared | |
parent | 1808a1f8e4b7b102823492a2007a46929aebf189 (diff) | |
download | PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.tar.gz PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.tar.zst PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.zip |
Rename studio to editor
Diffstat (limited to 'client/src/app/+video-studio/shared')
-rw-r--r-- | client/src/app/+video-studio/shared/index.ts | 1 | ||||
-rw-r--r-- | client/src/app/+video-studio/shared/video-studio.service.ts | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/client/src/app/+video-studio/shared/index.ts b/client/src/app/+video-studio/shared/index.ts new file mode 100644 index 000000000..9940ac6a9 --- /dev/null +++ b/client/src/app/+video-studio/shared/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './video-studio.service' | |||
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 @@ | |||
1 | import { catchError } from 'rxjs' | ||
2 | import { HttpClient } from '@angular/common/http' | ||
3 | import { Injectable } from '@angular/core' | ||
4 | import { RestExtractor } from '@app/core' | ||
5 | import { objectToFormData } from '@app/helpers' | ||
6 | import { VideoService } from '@app/shared/shared-main' | ||
7 | import { VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' | ||
8 | |||
9 | @Injectable() | ||
10 | export class VideoStudioService { | ||
11 | |||
12 | constructor ( | ||
13 | private authHttp: HttpClient, | ||
14 | private restExtractor: RestExtractor | ||
15 | ) {} | ||
16 | |||
17 | editVideo (videoId: number | string, tasks: VideoStudioTask[]) { | ||
18 | const url = VideoService.BASE_VIDEO_URL + '/' + videoId + '/studio/edit' | ||
19 | const body: VideoStudioCreateEdition = { | ||
20 | tasks | ||
21 | } | ||
22 | |||
23 | const data = objectToFormData(body) | ||
24 | |||
25 | return this.authHttp.post(url, data) | ||
26 | .pipe(catchError(err => this.restExtractor.handleError(err))) | ||
27 | } | ||
28 | } | ||