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 /server/controllers/api/videos/index.ts | |
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 'server/controllers/api/videos/index.ts')
-rw-r--r-- | server/controllers/api/videos/index.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 3532c753e..4ae7ea2ed 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -39,6 +39,7 @@ import { | |||
39 | renamePromise | 39 | renamePromise |
40 | } from '../../../helpers' | 40 | } from '../../../helpers' |
41 | import { TagInstance } from '../../../models' | 41 | import { TagInstance } from '../../../models' |
42 | import { VideoCreate, VideoUpdate } from '../../../../shared' | ||
42 | 43 | ||
43 | import { abuseVideoRouter } from './abuse' | 44 | import { abuseVideoRouter } from './abuse' |
44 | import { blacklistRouter } from './blacklist' | 45 | import { blacklistRouter } from './blacklist' |
@@ -155,7 +156,7 @@ function addVideoRetryWrapper (req: express.Request, res: express.Response, next | |||
155 | } | 156 | } |
156 | 157 | ||
157 | function addVideo (req: express.Request, res: express.Response, videoFile: Express.Multer.File) { | 158 | function addVideo (req: express.Request, res: express.Response, videoFile: Express.Multer.File) { |
158 | const videoInfos = req.body | 159 | const videoInfos: VideoCreate = req.body |
159 | 160 | ||
160 | return db.sequelize.transaction(t => { | 161 | return db.sequelize.transaction(t => { |
161 | const user = res.locals.oauth.token.User | 162 | const user = res.locals.oauth.token.User |
@@ -257,7 +258,7 @@ function updateVideoRetryWrapper (req: express.Request, res: express.Response, n | |||
257 | function updateVideo (req: express.Request, res: express.Response) { | 258 | function updateVideo (req: express.Request, res: express.Response) { |
258 | const videoInstance = res.locals.video | 259 | const videoInstance = res.locals.video |
259 | const videoFieldsSave = videoInstance.toJSON() | 260 | const videoFieldsSave = videoInstance.toJSON() |
260 | const videoInfosToUpdate = req.body | 261 | const videoInfosToUpdate: VideoUpdate = req.body |
261 | 262 | ||
262 | return db.sequelize.transaction(t => { | 263 | return db.sequelize.transaction(t => { |
263 | let tagsPromise: Promise<TagInstance[]> | 264 | let tagsPromise: Promise<TagInstance[]> |