aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/videos/abuse.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts
index 39c841ffe..4ae899b7e 100644
--- a/server/controllers/api/videos/abuse.ts
+++ b/server/controllers/api/videos/abuse.ts
@@ -1,7 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared' 2import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared'
3import { logger } from '../../../helpers/logger' 3import { logger } from '../../../helpers/logger'
4import { getFormattedObjects } from '../../../helpers/utils' 4import { getFormattedObjects, getServerActor } from '../../../helpers/utils'
5import { sequelizeTypescript } from '../../../initializers' 5import { sequelizeTypescript } from '../../../initializers'
6import { 6import {
7 asyncMiddleware, 7 asyncMiddleware,
@@ -62,7 +62,16 @@ export {
62// --------------------------------------------------------------------------- 62// ---------------------------------------------------------------------------
63 63
64async function listVideoAbuses (req: express.Request, res: express.Response) { 64async function listVideoAbuses (req: express.Request, res: express.Response) {
65 const resultList = await VideoAbuseModel.listForApi(req.query.start, req.query.count, req.query.sort) 65 const user = res.locals.oauth.token.user
66 const serverActor = await getServerActor()
67
68 const resultList = await VideoAbuseModel.listForApi({
69 start: req.query.start,
70 count: req.query.count,
71 sort: req.query.sort,
72 serverAccountId: serverActor.Account.id,
73 user
74 })
66 75
67 return res.json(getFormattedObjects(resultList.data, resultList.total)) 76 return res.json(getFormattedObjects(resultList.data, resultList.total))
68} 77}