+
+ updateSecondStep () {
+ if (this.checkForm() === false) {
+ return
+ }
+
+ const video = new VideoEdit()
+ video.patch(this.form.value)
+ video.channelId = this.firstStepChannelId
+ video.id = this.videoUploadedIds.id
+ video.uuid = this.videoUploadedIds.uuid
+
+ this.isUpdatingVideo = true
+ this.loadingBar.start()
+ this.videoService.updateVideo(video)
+ .subscribe(
+ () => {
+ this.isUpdatingVideo = false
+ this.isUploadingVideo = false
+ this.loadingBar.complete()
+
+ this.notificationsService.success('Success', 'Video published.')
+ this.router.navigate([ '/videos/watch', video.uuid ])
+ },
+
+ err => {
+ this.isUpdatingVideo = false
+ this.notificationsService.error('Error', err.message)
+ console.error(err)
+ }
+ )
+
+ }