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/abuse.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/abuse.ts')
-rw-r--r-- | server/controllers/api/videos/abuse.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts index 3b1b7f58e..7d2e3bcfb 100644 --- a/server/controllers/api/videos/abuse.ts +++ b/server/controllers/api/videos/abuse.ts | |||
@@ -17,6 +17,7 @@ import { | |||
17 | setPagination | 17 | setPagination |
18 | } from '../../../middlewares' | 18 | } from '../../../middlewares' |
19 | import { VideoInstance } from '../../../models' | 19 | import { VideoInstance } from '../../../models' |
20 | import { VideoAbuseCreate } from '../../../../shared' | ||
20 | 21 | ||
21 | const abuseVideoRouter = express.Router() | 22 | const abuseVideoRouter = express.Router() |
22 | 23 | ||
@@ -63,10 +64,11 @@ function reportVideoAbuseRetryWrapper (req: express.Request, res: express.Respon | |||
63 | function reportVideoAbuse (req: express.Request, res: express.Response) { | 64 | function reportVideoAbuse (req: express.Request, res: express.Response) { |
64 | const videoInstance = res.locals.video | 65 | const videoInstance = res.locals.video |
65 | const reporterUsername = res.locals.oauth.token.User.username | 66 | const reporterUsername = res.locals.oauth.token.User.username |
67 | const body: VideoAbuseCreate = req.body | ||
66 | 68 | ||
67 | const abuse = { | 69 | const abuse = { |
68 | reporterUsername, | 70 | reporterUsername, |
69 | reason: req.body.reason, | 71 | reason: body.reason, |
70 | videoId: videoInstance.id, | 72 | videoId: videoInstance.id, |
71 | reporterPodId: null // This is our pod that reported this abuse | 73 | reporterPodId: null // This is our pod that reported this abuse |
72 | } | 74 | } |