From 7d8e778ad031873b2bcc273d281baf6559610f71 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 7 May 2018 11:31:23 +0200 Subject: Fix video channel update/create on empty fields --- .../my-account-video-channel-create.component.ts | 6 +++--- .../my-account-video-channel-update.component.ts | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'client/src/app/my-account/my-account-video-channels') diff --git a/client/src/app/my-account/my-account-video-channels/my-account-video-channel-create.component.ts b/client/src/app/my-account/my-account-video-channels/my-account-video-channel-create.component.ts index c3c0ae63a..0f03548ad 100644 --- a/client/src/app/my-account/my-account-video-channels/my-account-video-channel-create.component.ts +++ b/client/src/app/my-account/my-account-video-channels/my-account-video-channel-create.component.ts @@ -64,8 +64,8 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE const body = this.form.value const videoChannelCreate: VideoChannelCreate = { displayName: body['display-name'], - description: body.description, - support: body.support + description: body.description || undefined, + support: body.support || undefined } this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe( @@ -84,6 +84,6 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE } getFormButtonTitle () { - return 'Create this video channel' + return 'Create' } } diff --git a/client/src/app/my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/my-account/my-account-video-channels/my-account-video-channel-update.component.ts index 3cb8b9e9a..c0dc6a939 100644 --- a/client/src/app/my-account/my-account-video-channels/my-account-video-channel-update.component.ts +++ b/client/src/app/my-account/my-account-video-channels/my-account-video-channel-update.component.ts @@ -92,8 +92,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE const body = this.form.value const videoChannelUpdate: VideoChannelUpdate = { displayName: body['display-name'], - description: body.description, - support: body.support + description: body.description || undefined, + support: body.support || undefined } this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.uuid, videoChannelUpdate).subscribe( @@ -112,8 +112,6 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE } getFormButtonTitle () { - return this.videoChannelToUpdate - ? 'Update ' + this.videoChannelToUpdate.displayName + ' video channel' - : 'Update' + return 'Update' } } -- cgit v1.2.3