diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/abuse.ts | 13 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared' | 2 | import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared' |
3 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
4 | import { getFormattedObjects } from '../../../helpers/utils' | 4 | import { getFormattedObjects, getServerActor } from '../../../helpers/utils' |
5 | import { sequelizeTypescript } from '../../../initializers' | 5 | import { sequelizeTypescript } from '../../../initializers' |
6 | import { | 6 | import { |
7 | asyncMiddleware, | 7 | asyncMiddleware, |
@@ -62,7 +62,16 @@ export { | |||
62 | // --------------------------------------------------------------------------- | 62 | // --------------------------------------------------------------------------- |
63 | 63 | ||
64 | async function listVideoAbuses (req: express.Request, res: express.Response) { | 64 | async 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 | } |