diff options
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/shared/video.service.ts | 5 | ||||
-rw-r--r-- | client/src/app/videos/video-edit/video-update.component.ts | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index ba83c72fd..ef683dea6 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts | |||
@@ -81,14 +81,17 @@ export class VideoService { | |||
81 | } | 81 | } |
82 | 82 | ||
83 | updateVideo(video: Video) { | 83 | updateVideo(video: Video) { |
84 | const language = video.language ? video.language : null; | ||
85 | |||
84 | const body = { | 86 | const body = { |
85 | name: video.name, | 87 | name: video.name, |
86 | category: video.category, | 88 | category: video.category, |
87 | licence: video.licence, | 89 | licence: video.licence, |
88 | language: video.language, | 90 | language, |
89 | description: video.description, | 91 | description: video.description, |
90 | tags: video.tags | 92 | tags: video.tags |
91 | }; | 93 | }; |
94 | |||
92 | const headers = new Headers({ 'Content-Type': 'application/json' }); | 95 | const headers = new Headers({ 'Content-Type': 'application/json' }); |
93 | const options = new RequestOptions({ headers: headers }); | 96 | const options = new RequestOptions({ headers: headers }); |
94 | 97 | ||
diff --git a/client/src/app/videos/video-edit/video-update.component.ts b/client/src/app/videos/video-edit/video-update.component.ts index adb3d295c..933132cc0 100644 --- a/client/src/app/videos/video-edit/video-update.component.ts +++ b/client/src/app/videos/video-edit/video-update.component.ts | |||
@@ -98,7 +98,17 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
98 | ); | 98 | ); |
99 | } | 99 | } |
100 | 100 | ||
101 | checkForm() { | ||
102 | this.forceCheck(); | ||
103 | |||
104 | return this.form.valid; | ||
105 | } | ||
106 | |||
101 | update() { | 107 | update() { |
108 | if (this.checkForm() === false) { | ||
109 | return; | ||
110 | } | ||
111 | |||
102 | this.video.patch(this.form.value); | 112 | this.video.patch(this.form.value); |
103 | 113 | ||
104 | this.videoService.updateVideo(this.video) | 114 | this.videoService.updateVideo(this.video) |