diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts index 167d7dd09..4887fdfb4 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts | |||
@@ -41,13 +41,17 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis | |||
41 | 41 | ||
42 | ngOnInit () { | 42 | ngOnInit () { |
43 | this.buildForm({ | 43 | this.buildForm({ |
44 | 'display-name': this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME, | 44 | displayName: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME, |
45 | privacy: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_PRIVACY, | 45 | privacy: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_PRIVACY, |
46 | description: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DESCRIPTION, | 46 | description: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DESCRIPTION, |
47 | videoChannelId: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_CHANNEL_ID, | 47 | videoChannelId: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_CHANNEL_ID, |
48 | thumbnailfile: null | 48 | thumbnailfile: null |
49 | }) | 49 | }) |
50 | 50 | ||
51 | this.form.get('privacy').valueChanges.subscribe(privacy => { | ||
52 | this.videoPlaylistValidatorsService.setChannelValidator(this.form.get('videoChannelId'), privacy) | ||
53 | }) | ||
54 | |||
51 | populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) | 55 | populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) |
52 | 56 | ||
53 | this.paramsSub = this.route.params.subscribe(routeParams => { | 57 | this.paramsSub = this.route.params.subscribe(routeParams => { |
@@ -85,8 +89,8 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis | |||
85 | 89 | ||
86 | const body = this.form.value | 90 | const body = this.form.value |
87 | const videoPlaylistUpdate: VideoPlaylistUpdate = { | 91 | const videoPlaylistUpdate: VideoPlaylistUpdate = { |
88 | displayName: body['display-name'], | 92 | displayName: body.displayName, |
89 | privacy: body['privacy'], | 93 | privacy: body.privacy, |
90 | description: body.description || null, | 94 | description: body.description || null, |
91 | videoChannelId: body.videoChannelId || null, | 95 | videoChannelId: body.videoChannelId || null, |
92 | thumbnailfile: body.thumbnailfile || undefined | 96 | thumbnailfile: body.thumbnailfile || undefined |
@@ -115,7 +119,7 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis | |||
115 | 119 | ||
116 | private hydrateFormFromPlaylist () { | 120 | private hydrateFormFromPlaylist () { |
117 | this.form.patchValue({ | 121 | this.form.patchValue({ |
118 | 'display-name': this.videoPlaylistToUpdate.displayName, | 122 | displayName: this.videoPlaylistToUpdate.displayName, |
119 | privacy: this.videoPlaylistToUpdate.privacy.id, | 123 | privacy: this.videoPlaylistToUpdate.privacy.id, |
120 | description: this.videoPlaylistToUpdate.description, | 124 | description: this.videoPlaylistToUpdate.description, |
121 | videoChannelId: this.videoPlaylistToUpdate.videoChannel ? this.videoPlaylistToUpdate.videoChannel.id : null | 125 | videoChannelId: this.videoPlaylistToUpdate.videoChannel ? this.videoPlaylistToUpdate.videoChannel.id : null |