diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
commit | 69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch) | |
tree | ad199a18ec3c322460d6f9523fc383ee562554e0 /server/controllers/api/videos/abuse.ts | |
parent | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff) | |
download | PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip |
Type functions
Diffstat (limited to 'server/controllers/api/videos/abuse.ts')
-rw-r--r-- | server/controllers/api/videos/abuse.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts index 68db025b7..78e8e8b3d 100644 --- a/server/controllers/api/videos/abuse.ts +++ b/server/controllers/api/videos/abuse.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as Sequelize from 'sequelize' | ||
2 | import { waterfall } from 'async' | 3 | import { waterfall } from 'async' |
3 | 4 | ||
4 | import { database as db } from '../../../initializers/database' | 5 | import { database as db } from '../../../initializers/database' |
@@ -46,7 +47,7 @@ export { | |||
46 | 47 | ||
47 | // --------------------------------------------------------------------------- | 48 | // --------------------------------------------------------------------------- |
48 | 49 | ||
49 | function listVideoAbuses (req, res, next) { | 50 | function listVideoAbuses (req: express.Request, res: express.Response, next: express.NextFunction) { |
50 | db.VideoAbuse.listForApi(req.query.start, req.query.count, req.query.sort, function (err, abusesList, abusesTotal) { | 51 | db.VideoAbuse.listForApi(req.query.start, req.query.count, req.query.sort, function (err, abusesList, abusesTotal) { |
51 | if (err) return next(err) | 52 | if (err) return next(err) |
52 | 53 | ||
@@ -54,7 +55,7 @@ function listVideoAbuses (req, res, next) { | |||
54 | }) | 55 | }) |
55 | } | 56 | } |
56 | 57 | ||
57 | function reportVideoAbuseRetryWrapper (req, res, next) { | 58 | function reportVideoAbuseRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) { |
58 | const options = { | 59 | const options = { |
59 | arguments: [ req, res ], | 60 | arguments: [ req, res ], |
60 | errorMessage: 'Cannot report abuse to the video with many retries.' | 61 | errorMessage: 'Cannot report abuse to the video with many retries.' |
@@ -67,7 +68,7 @@ function reportVideoAbuseRetryWrapper (req, res, next) { | |||
67 | }) | 68 | }) |
68 | } | 69 | } |
69 | 70 | ||
70 | function reportVideoAbuse (req, res, finalCallback) { | 71 | function reportVideoAbuse (req: express.Request, res: express.Response, finalCallback: (err: Error) => void) { |
71 | const videoInstance = res.locals.video | 72 | const videoInstance = res.locals.video |
72 | const reporterUsername = res.locals.oauth.token.User.username | 73 | const reporterUsername = res.locals.oauth.token.User.username |
73 | 74 | ||
@@ -105,7 +106,7 @@ function reportVideoAbuse (req, res, finalCallback) { | |||
105 | 106 | ||
106 | commitTransaction | 107 | commitTransaction |
107 | 108 | ||
108 | ], function andFinally (err, t) { | 109 | ], function andFinally (err: Error, t: Sequelize.Transaction) { |
109 | if (err) { | 110 | if (err) { |
110 | logger.debug('Cannot update the video.', { error: err }) | 111 | logger.debug('Cannot update the video.', { error: err }) |
111 | return rollbackTransaction(err, t, finalCallback) | 112 | return rollbackTransaction(err, t, finalCallback) |