diff options
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/shared/misc/utils.ts | 5 | ||||
-rw-r--r-- | client/src/app/videos/+video-edit/shared/video-edit.component.ts | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index b5bf99be2..b9aa223cf 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts | |||
@@ -66,6 +66,11 @@ 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 (Array.isArray(obj[key]) && obj[key].length === 0) { | ||
70 | fd.append(key, null) | ||
71 | continue | ||
72 | } | ||
73 | |||
69 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { | 74 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { |
70 | objectToFormData(obj[ key ], fd, key) | 75 | objectToFormData(obj[ key ], fd, key) |
71 | } else { | 76 | } else { |
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index af4438bd2..d4567e26c 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts | |||
@@ -80,7 +80,7 @@ export class VideoEditComponent implements OnInit { | |||
80 | this.form.addControl('licence', new FormControl('', VIDEO_LICENCE.VALIDATORS)) | 80 | this.form.addControl('licence', new FormControl('', VIDEO_LICENCE.VALIDATORS)) |
81 | this.form.addControl('language', new FormControl('', VIDEO_LANGUAGE.VALIDATORS)) | 81 | this.form.addControl('language', new FormControl('', VIDEO_LANGUAGE.VALIDATORS)) |
82 | this.form.addControl('description', new FormControl('', VIDEO_DESCRIPTION.VALIDATORS)) | 82 | this.form.addControl('description', new FormControl('', VIDEO_DESCRIPTION.VALIDATORS)) |
83 | this.form.addControl('tags', new FormControl('')) | 83 | this.form.addControl('tags', new FormControl([])) |
84 | this.form.addControl('thumbnailfile', new FormControl('')) | 84 | this.form.addControl('thumbnailfile', new FormControl('')) |
85 | this.form.addControl('previewfile', new FormControl('')) | 85 | this.form.addControl('previewfile', new FormControl('')) |
86 | this.form.addControl('support', new FormControl('', VIDEO_SUPPORT.VALIDATORS)) | 86 | this.form.addControl('support', new FormControl('', VIDEO_SUPPORT.VALIDATORS)) |