diff options
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 01d32176b..2e7138cd1 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -18,6 +18,7 @@ import { SortField } from './sort-field.type' | |||
18 | import { VideoDetails } from './video-details.model' | 18 | import { VideoDetails } from './video-details.model' |
19 | import { VideoEdit } from './video-edit.model' | 19 | import { VideoEdit } from './video-edit.model' |
20 | import { Video } from './video.model' | 20 | import { Video } from './video.model' |
21 | import { objectToFormData } from '@app/shared/misc/utils' | ||
21 | 22 | ||
22 | @Injectable() | 23 | @Injectable() |
23 | export class VideoService { | 24 | export class VideoService { |
@@ -46,10 +47,10 @@ export class VideoService { | |||
46 | } | 47 | } |
47 | 48 | ||
48 | updateVideo (video: VideoEdit) { | 49 | updateVideo (video: VideoEdit) { |
49 | const language = video.language || null | 50 | const language = video.language || undefined |
50 | const licence = video.licence || null | 51 | const licence = video.licence || undefined |
51 | const category = video.category || null | 52 | const category = video.category || undefined |
52 | const description = video.description || null | 53 | const description = video.description || undefined |
53 | 54 | ||
54 | const body: VideoUpdate = { | 55 | const body: VideoUpdate = { |
55 | name: video.name, | 56 | name: video.name, |
@@ -60,10 +61,14 @@ export class VideoService { | |||
60 | privacy: video.privacy, | 61 | privacy: video.privacy, |
61 | tags: video.tags, | 62 | tags: video.tags, |
62 | nsfw: video.nsfw, | 63 | nsfw: video.nsfw, |
63 | commentsEnabled: video.commentsEnabled | 64 | commentsEnabled: video.commentsEnabled, |
65 | thumbnailfile: video.thumbnailfile, | ||
66 | previewfile: video.previewfile | ||
64 | } | 67 | } |
65 | 68 | ||
66 | return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, body) | 69 | const data = objectToFormData(body) |
70 | |||
71 | return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) | ||
67 | .map(this.restExtractor.extractDataBool) | 72 | .map(this.restExtractor.extractDataBool) |
68 | .catch(this.restExtractor.handleError) | 73 | .catch(this.restExtractor.handleError) |
69 | } | 74 | } |