diff options
Diffstat (limited to 'client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts')
-rw-r--r-- | client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts index eb24a60c5..e8bfbf9ce 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts | |||
@@ -52,21 +52,22 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements | |||
52 | this.paramsSub = this.route.params.subscribe(routeParams => { | 52 | this.paramsSub = this.route.params.subscribe(routeParams => { |
53 | const videoChannelId = routeParams['videoChannelId'] | 53 | const videoChannelId = routeParams['videoChannelId'] |
54 | 54 | ||
55 | this.videoChannelService.getVideoChannel(videoChannelId).subscribe( | 55 | this.videoChannelService.getVideoChannel(videoChannelId) |
56 | videoChannelToUpdate => { | 56 | .subscribe({ |
57 | this.videoChannel = videoChannelToUpdate | 57 | next: videoChannelToUpdate => { |
58 | 58 | this.videoChannel = videoChannelToUpdate | |
59 | this.oldSupportField = videoChannelToUpdate.support | 59 | |
60 | 60 | this.oldSupportField = videoChannelToUpdate.support | |
61 | this.form.patchValue({ | 61 | |
62 | 'display-name': videoChannelToUpdate.displayName, | 62 | this.form.patchValue({ |
63 | description: videoChannelToUpdate.description, | 63 | 'display-name': videoChannelToUpdate.displayName, |
64 | support: videoChannelToUpdate.support | 64 | description: videoChannelToUpdate.description, |
65 | }) | 65 | support: videoChannelToUpdate.support |
66 | }, | 66 | }) |
67 | }, | ||
67 | 68 | ||
68 | err => this.error = err.message | 69 | error: err => this.error = err.message |
69 | ) | 70 | }) |
70 | }) | 71 | }) |
71 | } | 72 | } |
72 | 73 | ||
@@ -85,77 +86,78 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements | |||
85 | bulkVideosSupportUpdate: body.bulkVideosSupportUpdate || false | 86 | bulkVideosSupportUpdate: body.bulkVideosSupportUpdate || false |
86 | } | 87 | } |
87 | 88 | ||
88 | this.videoChannelService.updateVideoChannel(this.videoChannel.name, videoChannelUpdate).subscribe( | 89 | this.videoChannelService.updateVideoChannel(this.videoChannel.name, videoChannelUpdate) |
89 | () => { | 90 | .subscribe({ |
90 | this.authService.refreshUserInformation() | 91 | next: () => { |
92 | this.authService.refreshUserInformation() | ||
91 | 93 | ||
92 | this.notifier.success($localize`Video channel ${videoChannelUpdate.displayName} updated.`) | 94 | this.notifier.success($localize`Video channel ${videoChannelUpdate.displayName} updated.`) |
93 | 95 | ||
94 | this.router.navigate([ '/my-library', 'video-channels' ]) | 96 | this.router.navigate([ '/my-library', 'video-channels' ]) |
95 | }, | 97 | }, |
96 | 98 | ||
97 | err => this.error = err.message | 99 | error: err => this.error = err.message |
98 | ) | 100 | }) |
99 | } | 101 | } |
100 | 102 | ||
101 | onAvatarChange (formData: FormData) { | 103 | onAvatarChange (formData: FormData) { |
102 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'avatar') | 104 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'avatar') |
103 | .subscribe( | 105 | .subscribe({ |
104 | data => { | 106 | next: data => { |
105 | this.notifier.success($localize`Avatar changed.`) | 107 | this.notifier.success($localize`Avatar changed.`) |
106 | 108 | ||
107 | this.videoChannel.updateAvatar(data.avatar) | 109 | this.videoChannel.updateAvatar(data.avatar) |
108 | }, | 110 | }, |
109 | 111 | ||
110 | (err: HttpErrorResponse) => genericUploadErrorHandler({ | 112 | error: (err: HttpErrorResponse) => genericUploadErrorHandler({ |
111 | err, | 113 | err, |
112 | name: $localize`avatar`, | 114 | name: $localize`avatar`, |
113 | notifier: this.notifier | 115 | notifier: this.notifier |
114 | }) | 116 | }) |
115 | ) | 117 | }) |
116 | } | 118 | } |
117 | 119 | ||
118 | onAvatarDelete () { | 120 | onAvatarDelete () { |
119 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'avatar') | 121 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'avatar') |
120 | .subscribe( | 122 | .subscribe({ |
121 | data => { | 123 | next: () => { |
122 | this.notifier.success($localize`Avatar deleted.`) | 124 | this.notifier.success($localize`Avatar deleted.`) |
123 | 125 | ||
124 | this.videoChannel.resetAvatar() | 126 | this.videoChannel.resetAvatar() |
125 | }, | 127 | }, |
126 | 128 | ||
127 | err => this.notifier.error(err.message) | 129 | error: err => this.notifier.error(err.message) |
128 | ) | 130 | }) |
129 | } | 131 | } |
130 | 132 | ||
131 | onBannerChange (formData: FormData) { | 133 | onBannerChange (formData: FormData) { |
132 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'banner') | 134 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'banner') |
133 | .subscribe( | 135 | .subscribe({ |
134 | data => { | 136 | next: data => { |
135 | this.notifier.success($localize`Banner changed.`) | 137 | this.notifier.success($localize`Banner changed.`) |
136 | 138 | ||
137 | this.videoChannel.updateBanner(data.banner) | 139 | this.videoChannel.updateBanner(data.banner) |
138 | }, | 140 | }, |
139 | 141 | ||
140 | (err: HttpErrorResponse) => genericUploadErrorHandler({ | 142 | error: (err: HttpErrorResponse) => genericUploadErrorHandler({ |
141 | err, | 143 | err, |
142 | name: $localize`banner`, | 144 | name: $localize`banner`, |
143 | notifier: this.notifier | 145 | notifier: this.notifier |
144 | }) | 146 | }) |
145 | ) | 147 | }) |
146 | } | 148 | } |
147 | 149 | ||
148 | onBannerDelete () { | 150 | onBannerDelete () { |
149 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'banner') | 151 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'banner') |
150 | .subscribe( | 152 | .subscribe({ |
151 | data => { | 153 | next: () => { |
152 | this.notifier.success($localize`Banner deleted.`) | 154 | this.notifier.success($localize`Banner deleted.`) |
153 | 155 | ||
154 | this.videoChannel.resetBanner() | 156 | this.videoChannel.resetBanner() |
155 | }, | 157 | }, |
156 | 158 | ||
157 | err => this.notifier.error(err.message) | 159 | error: err => this.notifier.error(err.message) |
158 | ) | 160 | }) |
159 | } | 161 | } |
160 | 162 | ||
161 | get maxAvatarSize () { | 163 | get maxAvatarSize () { |