diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-10 19:43:21 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-10 19:43:21 +0200 |
commit | 4771e0008dd26eadbb7eaff64255a6ec914fdadb (patch) | |
tree | 4fd58f8a3f3c2d674b936c99817b4f5fb958c5d8 /client/src/app/videos/video-edit | |
parent | 7a214f746bf420defbf17fa218d90d6233551bf8 (diff) | |
download | PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.gz PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.zst PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.zip |
Better typescript typing for a better world
Diffstat (limited to 'client/src/app/videos/video-edit')
-rw-r--r-- | client/src/app/videos/video-edit/video-add.component.ts | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/client/src/app/videos/video-edit/video-add.component.ts b/client/src/app/videos/video-edit/video-add.component.ts index 0653f5ac4..5d6c0e0c7 100644 --- a/client/src/app/videos/video-edit/video-add.component.ts +++ b/client/src/app/videos/video-edit/video-add.component.ts | |||
@@ -16,6 +16,7 @@ import { | |||
16 | VIDEO_TAGS | 16 | VIDEO_TAGS |
17 | } from '../../shared' | 17 | } from '../../shared' |
18 | import { VideoService } from '../shared' | 18 | import { VideoService } from '../shared' |
19 | import { VideoCreate } from '../../../../../shared' | ||
19 | 20 | ||
20 | @Component({ | 21 | @Component({ |
21 | selector: 'my-videos-add', | 22 | selector: 'my-videos-add', |
@@ -98,23 +99,25 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
98 | removeAfterUpload: true | 99 | removeAfterUpload: true |
99 | }) | 100 | }) |
100 | 101 | ||
101 | this.uploader.onBuildItemForm = (item, form) => { | 102 | this.uploader.onBuildItemForm = (item, form: FormData) => { |
102 | const name = this.form.value['name'] | 103 | const formValue: VideoCreate = this.form.value |
103 | const nsfw = this.form.value['nsfw'] | 104 | |
104 | const category = this.form.value['category'] | 105 | const name = formValue.name |
105 | const licence = this.form.value['licence'] | 106 | const nsfw = formValue.nsfw |
106 | const language = this.form.value['language'] | 107 | const category = formValue.category |
107 | const description = this.form.value['description'] | 108 | const licence = formValue.licence |
108 | const tags = this.form.value['tags'] | 109 | const language = formValue.language |
110 | const description = formValue.description | ||
111 | const tags = formValue.tags | ||
109 | 112 | ||
110 | form.append('name', name) | 113 | form.append('name', name) |
111 | form.append('category', category) | 114 | form.append('category', '' + category) |
112 | form.append('nsfw', nsfw) | 115 | form.append('nsfw', '' + nsfw) |
113 | form.append('licence', licence) | 116 | form.append('licence', '' + licence) |
114 | 117 | ||
115 | // Language is optional | 118 | // Language is optional |
116 | if (language) { | 119 | if (language) { |
117 | form.append('language', language) | 120 | form.append('language', '' + language) |
118 | } | 121 | } |
119 | 122 | ||
120 | form.append('description', description) | 123 | form.append('description', description) |