From a4b8a4ddccc926e0670d3687cccd52496f6f8a8f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Dec 2017 11:09:15 +0100 Subject: Redirect to uuid video route after upload --- client/src/app/videos/+video-edit/video-add.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'client/src') diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 503f705db..90510d0dc 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -25,7 +25,10 @@ export class VideoAddComponent extends FormReactive implements OnInit { isUploadingVideo = false videoUploaded = false videoUploadPercents = 0 - videoUploadedId = 0 + videoUploadedIds = { + id: 0, + uuid: '' + } error: string = null form: FormGroup @@ -122,7 +125,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { this.videoUploaded = true - this.videoUploadedId = event.body.video.id + this.videoUploadedIds = event.body.video } }, @@ -142,13 +145,14 @@ export class VideoAddComponent extends FormReactive implements OnInit { const video = new VideoEdit() video.patch(this.form.value) video.channel = this.firstStepChannelId - video.id = this.videoUploadedId + video.id = this.videoUploadedIds.id + video.uuid = this.videoUploadedIds.uuid this.videoService.updateVideo(video) .subscribe( () => { this.notificationsService.success('Success', 'Video published.') - this.router.navigate([ '/videos/watch', video.id ]) + this.router.navigate([ '/videos/watch', video.uuid ]) }, err => { -- cgit v1.2.3