aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r--server/controllers/api/videos/abuse.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts
index b92a66360..9c4d00849 100644
--- a/server/controllers/api/videos/abuse.ts
+++ b/server/controllers/api/videos/abuse.ts
@@ -2,7 +2,6 @@ import * as express from 'express'
2import { AbuseModel } from '@server/models/abuse/abuse' 2import { AbuseModel } from '@server/models/abuse/abuse'
3import { getServerActor } from '@server/models/application/application' 3import { getServerActor } from '@server/models/application/application'
4import { AbuseCreate, UserRight, VideoAbuseCreate } from '../../../../shared' 4import { AbuseCreate, UserRight, VideoAbuseCreate } from '../../../../shared'
5import { getFormattedObjects } from '../../../helpers/utils'
6import { 5import {
7 abusesSortValidator, 6 abusesSortValidator,
8 asyncMiddleware, 7 asyncMiddleware,
@@ -63,7 +62,7 @@ async function listVideoAbuses (req: express.Request, res: express.Response) {
63 const user = res.locals.oauth.token.user 62 const user = res.locals.oauth.token.user
64 const serverActor = await getServerActor() 63 const serverActor = await getServerActor()
65 64
66 const resultList = await AbuseModel.listForApi({ 65 const resultList = await AbuseModel.listForAdminApi({
67 start: req.query.start, 66 start: req.query.start,
68 count: req.query.count, 67 count: req.query.count,
69 sort: req.query.sort, 68 sort: req.query.sort,
@@ -81,7 +80,10 @@ async function listVideoAbuses (req: express.Request, res: express.Response) {
81 user 80 user
82 }) 81 })
83 82
84 return res.json(getFormattedObjects(resultList.data, resultList.total)) 83 return res.json({
84 total: resultList.total,
85 data: resultList.data.map(d => d.toFormattedAdminJSON())
86 })
85} 87}
86 88
87async function updateVideoAbuse (req: express.Request, res: express.Response) { 89async function updateVideoAbuse (req: express.Request, res: express.Response) {