diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:35:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:35:15 +0100 |
commit | dae86118ed5d4026d04acb9d0e36829b9ad8eb4e (patch) | |
tree | a5bf9c4487240bf75a9b328cad459a0587f90dea /server/controllers/api/videos/index.ts | |
parent | e65c0c5b1fab9c3d93f51721b2458cf5cf471f20 (diff) | |
download | PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.tar.gz PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.tar.zst PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.zip |
Cleanup express locals typings
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r-- | server/controllers/api/videos/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 27f67895e..db4f4c96f 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -295,7 +295,7 @@ async function addVideo (req: express.Request, res: express.Response) { | |||
295 | } | 295 | } |
296 | 296 | ||
297 | async function updateVideo (req: express.Request, res: express.Response) { | 297 | async function updateVideo (req: express.Request, res: express.Response) { |
298 | const videoInstance: VideoModel = res.locals.video | 298 | const videoInstance = res.locals.video |
299 | const videoFieldsSave = videoInstance.toJSON() | 299 | const videoFieldsSave = videoInstance.toJSON() |
300 | const oldVideoAuditView = new VideoAuditView(videoInstance.toFormattedDetailsJSON()) | 300 | const oldVideoAuditView = new VideoAuditView(videoInstance.toFormattedDetailsJSON()) |
301 | const videoInfoToUpdate: VideoUpdate = req.body | 301 | const videoInfoToUpdate: VideoUpdate = req.body |
@@ -407,7 +407,7 @@ async function updateVideo (req: express.Request, res: express.Response) { | |||
407 | async function getVideo (req: express.Request, res: express.Response) { | 407 | async function getVideo (req: express.Request, res: express.Response) { |
408 | // We need more attributes | 408 | // We need more attributes |
409 | const userId: number = res.locals.oauth ? res.locals.oauth.token.User.id : null | 409 | const userId: number = res.locals.oauth ? res.locals.oauth.token.User.id : null |
410 | const video: VideoModel = await VideoModel.loadForGetAPI(res.locals.video.id, undefined, userId) | 410 | const video = await VideoModel.loadForGetAPI(res.locals.video.id, undefined, userId) |
411 | 411 | ||
412 | if (video.isOutdated()) { | 412 | if (video.isOutdated()) { |
413 | JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', url: video.url } }) | 413 | JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', url: video.url } }) |
@@ -472,7 +472,7 @@ async function listVideos (req: express.Request, res: express.Response) { | |||
472 | } | 472 | } |
473 | 473 | ||
474 | async function removeVideo (req: express.Request, res: express.Response) { | 474 | async function removeVideo (req: express.Request, res: express.Response) { |
475 | const videoInstance: VideoModel = res.locals.video | 475 | const videoInstance = res.locals.video |
476 | 476 | ||
477 | await sequelizeTypescript.transaction(async t => { | 477 | await sequelizeTypescript.transaction(async t => { |
478 | await videoInstance.destroy({ transaction: t }) | 478 | await videoInstance.destroy({ transaction: t }) |