aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-09 11:23:14 +0200
committerChocobozzz <me@florianbigard.com>2018-05-09 11:41:18 +0200
commit360329cc029c062bfb145c90f7bf1c007c39af81 (patch)
treea40fb8e31c0d40d65a83e9f0fbc12793230b5c0e /client
parentbf696869538eaef27e5a8445035967c01f214501 (diff)
downloadPeerTube-360329cc029c062bfb145c90f7bf1c007c39af81.tar.gz
PeerTube-360329cc029c062bfb145c90f7bf1c007c39af81.tar.zst
PeerTube-360329cc029c062bfb145c90f7bf1c007c39af81.zip
Account/channel descriptions are not required anymore
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts2
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts4
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts4
-rw-r--r--client/src/app/shared/forms/form-validators/user.ts2
-rw-r--r--client/src/app/shared/misc/utils.ts2
-rw-r--r--client/src/app/shared/video/video.service.ts10
6 files changed, 11 insertions, 13 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
index 2b7ba353c..468be022c 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
@@ -47,7 +47,7 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
47 47
48 updateMyProfile () { 48 updateMyProfile () {
49 const displayName = this.form.value['display-name'] 49 const displayName = this.form.value['display-name']
50 const description = this.form.value['description'] 50 const description = this.form.value['description'] || null
51 51
52 this.error = null 52 this.error = null
53 53
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 0f03548ad..fab9cacd8 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
64 const body = this.form.value 64 const body = this.form.value
65 const videoChannelCreate: VideoChannelCreate = { 65 const videoChannelCreate: VideoChannelCreate = {
66 displayName: body['display-name'], 66 displayName: body['display-name'],
67 description: body.description || undefined, 67 description: body.description || null,
68 support: body.support || undefined 68 support: body.support || null
69 } 69 }
70 70
71 this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe( 71 this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe(
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 c0dc6a939..9adc38691 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
92 const body = this.form.value 92 const body = this.form.value
93 const videoChannelUpdate: VideoChannelUpdate = { 93 const videoChannelUpdate: VideoChannelUpdate = {
94 displayName: body['display-name'], 94 displayName: body['display-name'],
95 description: body.description || undefined, 95 description: body.description || null,
96 support: body.support || undefined 96 support: body.support || null
97 } 97 }
98 98
99 this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.uuid, videoChannelUpdate).subscribe( 99 this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.uuid, videoChannelUpdate).subscribe(
diff --git a/client/src/app/shared/forms/form-validators/user.ts b/client/src/app/shared/forms/form-validators/user.ts
index c6b65e0df..0973f1b00 100644
--- a/client/src/app/shared/forms/form-validators/user.ts
+++ b/client/src/app/shared/forms/form-validators/user.ts
@@ -60,12 +60,10 @@ export const USER_DISPLAY_NAME = {
60} 60}
61export const USER_DESCRIPTION = { 61export const USER_DESCRIPTION = {
62 VALIDATORS: [ 62 VALIDATORS: [
63 Validators.required,
64 Validators.minLength(3), 63 Validators.minLength(3),
65 Validators.maxLength(250) 64 Validators.maxLength(250)
66 ], 65 ],
67 MESSAGES: { 66 MESSAGES: {
68 'required': 'Description is required.',
69 'minlength': 'Description must be at least 3 characters long.', 67 'minlength': 'Description must be at least 3 characters long.',
70 'maxlength': 'Description cannot be more than 250 characters long.' 68 'maxlength': 'Description cannot be more than 250 characters long.'
71 } 69 }
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts
index 99f6b3cf0..b5bf99be2 100644
--- a/client/src/app/shared/misc/utils.ts
+++ b/client/src/app/shared/misc/utils.ts
@@ -66,7 +66,7 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) {
66 66
67 if (obj[key] === undefined) continue 67 if (obj[key] === undefined) continue
68 68
69 if (typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { 69 if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) {
70 objectToFormData(obj[ key ], fd, key) 70 objectToFormData(obj[ key ], fd, key)
71 } else { 71 } else {
72 fd.append(formKey, obj[ key ]) 72 fd.append(formKey, obj[ key ])
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts
index 8870cbee4..b45777c55 100644
--- a/client/src/app/shared/video/video.service.ts
+++ b/client/src/app/shared/video/video.service.ts
@@ -54,11 +54,11 @@ export class VideoService {
54 } 54 }
55 55
56 updateVideo (video: VideoEdit) { 56 updateVideo (video: VideoEdit) {
57 const language = video.language || undefined 57 const language = video.language || null
58 const licence = video.licence || undefined 58 const licence = video.licence || null
59 const category = video.category || undefined 59 const category = video.category || null
60 const description = video.description || undefined 60 const description = video.description || null
61 const support = video.support || undefined 61 const support = video.support || null
62 62
63 const body: VideoUpdate = { 63 const body: VideoUpdate = {
64 name: video.name, 64 name: video.name,