diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:28:18 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:42:56 +0200 |
commit | 2efd32f697549c59337db5177a93749af8e605d8 (patch) | |
tree | 42adaa4bb67b6aa48dcd4fb660616fb37b611573 /client/src/app | |
parent | 17c49e60b367868c80f44b9921793dc3a2d9adaa (diff) | |
download | PeerTube-2efd32f697549c59337db5177a93749af8e605d8.tar.gz PeerTube-2efd32f697549c59337db5177a93749af8e605d8.tar.zst PeerTube-2efd32f697549c59337db5177a93749af8e605d8.zip |
Fix updating video tags to empty field
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)) |