aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/abuse.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-10 19:43:21 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-10 19:43:21 +0200
commit4771e0008dd26eadbb7eaff64255a6ec914fdadb (patch)
tree4fd58f8a3f3c2d674b936c99817b4f5fb958c5d8 /server/controllers/api/videos/abuse.ts
parent7a214f746bf420defbf17fa218d90d6233551bf8 (diff)
downloadPeerTube-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.ts4
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'
19import { VideoInstance } from '../../../models' 19import { VideoInstance } from '../../../models'
20import { VideoAbuseCreate } from '../../../../shared'
20 21
21const abuseVideoRouter = express.Router() 22const abuseVideoRouter = express.Router()
22 23
@@ -63,10 +64,11 @@ function reportVideoAbuseRetryWrapper (req: express.Request, res: express.Respon
63function reportVideoAbuse (req: express.Request, res: express.Response) { 64function 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 }