diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-18 14:35:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-18 14:35:31 +0200 |
commit | c199c427d4ae586339822320f20f512a7a19dc3f (patch) | |
tree | 9cbe8bebc25e97d2e8086c41bcd7180dd752dbac /client/src/app/shared/video/video-edit.model.ts | |
parent | cdf4cb9eaf5f6bc71f7c1e1963c07575f1d2593d (diff) | |
download | PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.gz PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.zst PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.zip |
Better typings
Diffstat (limited to 'client/src/app/shared/video/video-edit.model.ts')
-rw-r--r-- | client/src/app/shared/video/video-edit.model.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts index a62277e04..fc772a3cf 100644 --- a/client/src/app/shared/video/video-edit.model.ts +++ b/client/src/app/shared/video/video-edit.model.ts | |||
@@ -25,7 +25,6 @@ export class VideoEdit implements VideoUpdate { | |||
25 | uuid?: string | 25 | uuid?: string |
26 | id?: number | 26 | id?: number |
27 | scheduleUpdate?: VideoScheduleUpdate | 27 | scheduleUpdate?: VideoScheduleUpdate |
28 | [key: string]: any | ||
29 | 28 | ||
30 | constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) { | 29 | constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) { |
31 | if (video) { | 30 | if (video) { |
@@ -50,14 +49,14 @@ export class VideoEdit implements VideoUpdate { | |||
50 | } | 49 | } |
51 | } | 50 | } |
52 | 51 | ||
53 | patch (values: any) { | 52 | patch (values: { [ id: string ]: string }) { |
54 | Object.keys(values).forEach((key) => { | 53 | Object.keys(values).forEach((key) => { |
55 | this[ key ] = values[ key ] | 54 | this[ key ] = values[ key ] |
56 | }) | 55 | }) |
57 | 56 | ||
58 | // If schedule publication, the video is private and will be changed to public privacy | 57 | // If schedule publication, the video is private and will be changed to public privacy |
59 | if (parseInt(values['privacy'], 10) === VideoEdit.SPECIAL_SCHEDULED_PRIVACY) { | 58 | if (parseInt(values['privacy'], 10) === VideoEdit.SPECIAL_SCHEDULED_PRIVACY) { |
60 | const updateAt = (values['schedulePublicationAt'] as Date) | 59 | const updateAt = new Date(values['schedulePublicationAt']) |
61 | updateAt.setSeconds(0) | 60 | updateAt.setSeconds(0) |
62 | 61 | ||
63 | this.privacy = VideoPrivacy.PRIVATE | 62 | this.privacy = VideoPrivacy.PRIVATE |