From 4771e0008dd26eadbb7eaff64255a6ec914fdadb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 10 Jul 2017 19:43:21 +0200 Subject: Better typescript typing for a better world --- server/controllers/api/videos/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/videos/index.ts') 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 { renamePromise } from '../../../helpers' import { TagInstance } from '../../../models' +import { VideoCreate, VideoUpdate } from '../../../../shared' import { abuseVideoRouter } from './abuse' import { blacklistRouter } from './blacklist' @@ -155,7 +156,7 @@ function addVideoRetryWrapper (req: express.Request, res: express.Response, next } function addVideo (req: express.Request, res: express.Response, videoFile: Express.Multer.File) { - const videoInfos = req.body + const videoInfos: VideoCreate = req.body return db.sequelize.transaction(t => { const user = res.locals.oauth.token.User @@ -257,7 +258,7 @@ function updateVideoRetryWrapper (req: express.Request, res: express.Response, n function updateVideo (req: express.Request, res: express.Response) { const videoInstance = res.locals.video const videoFieldsSave = videoInstance.toJSON() - const videoInfosToUpdate = req.body + const videoInfosToUpdate: VideoUpdate = req.body return db.sequelize.transaction(t => { let tagsPromise: Promise -- cgit v1.2.3