1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Cleanup express locals typings

This commit is contained in:
Chocobozzz 2019-03-19 10:35:15 +01:00
parent e65c0c5b1f
commit dae86118ed
No known key found for this signature in database
GPG key ID: 583A612D890159BE
45 changed files with 270 additions and 234 deletions

View file

@ -5,7 +5,6 @@ import { createReqFiles } from '../../../helpers/express-utils'
import { CONFIG, MIMETYPES, sequelizeTypescript } from '../../../initializers'
import { getFormattedObjects } from '../../../helpers/utils'
import { VideoCaptionModel } from '../../../models/video/video-caption'
import { VideoModel } from '../../../models/video/video'
import { logger } from '../../../helpers/logger'
import { federateVideoIfNeeded } from '../../../lib/activitypub'
import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
@ -52,7 +51,7 @@ async function listVideoCaptions (req: express.Request, res: express.Response) {
async function addVideoCaption (req: express.Request, res: express.Response) {
const videoCaptionPhysicalFile = req.files['captionfile'][0]
const video = res.locals.video as VideoModel
const video = res.locals.video
const videoCaption = new VideoCaptionModel({
videoId: video.id,
@ -74,8 +73,8 @@ async function addVideoCaption (req: express.Request, res: express.Response) {
}
async function deleteVideoCaption (req: express.Request, res: express.Response) {
const video = res.locals.video as VideoModel
const videoCaption = res.locals.videoCaption as VideoCaptionModel
const video = res.locals.video
const videoCaption = res.locals.videoCaption
await sequelizeTypescript.transaction(async t => {
await videoCaption.destroy({ transaction: t })