aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-07 10:57:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-10 14:02:41 +0200
commit57f6896f67cfc570cf3605dd94b0778101b2d9b9 (patch)
treeb82d879c46868ce75ff76c3e4d4eed590a87f6c4 /server/controllers/api
parentd95d15598847c7f020aa056e7e6e0c02d2bbf732 (diff)
downloadPeerTube-57f6896f67cfc570cf3605dd94b0778101b2d9b9.tar.gz
PeerTube-57f6896f67cfc570cf3605dd94b0778101b2d9b9.tar.zst
PeerTube-57f6896f67cfc570cf3605dd94b0778101b2d9b9.zip
Implement abuses check params
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/abuse.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/api/abuse.ts b/server/controllers/api/abuse.ts
index ee046cb3a..38808021d 100644
--- a/server/controllers/api/abuse.ts
+++ b/server/controllers/api/abuse.ts
@@ -23,7 +23,7 @@ import { AccountModel } from '../../models/account/account'
23 23
24const abuseRouter = express.Router() 24const abuseRouter = express.Router()
25 25
26abuseRouter.get('/abuse', 26abuseRouter.get('/',
27 authenticate, 27 authenticate,
28 ensureUserHasRight(UserRight.MANAGE_ABUSES), 28 ensureUserHasRight(UserRight.MANAGE_ABUSES),
29 paginationValidator, 29 paginationValidator,
@@ -33,18 +33,18 @@ abuseRouter.get('/abuse',
33 abuseListValidator, 33 abuseListValidator,
34 asyncMiddleware(listAbuses) 34 asyncMiddleware(listAbuses)
35) 35)
36abuseRouter.put('/:videoId/abuse/:id', 36abuseRouter.put('/:id',
37 authenticate, 37 authenticate,
38 ensureUserHasRight(UserRight.MANAGE_ABUSES), 38 ensureUserHasRight(UserRight.MANAGE_ABUSES),
39 asyncMiddleware(abuseUpdateValidator), 39 asyncMiddleware(abuseUpdateValidator),
40 asyncRetryTransactionMiddleware(updateAbuse) 40 asyncRetryTransactionMiddleware(updateAbuse)
41) 41)
42abuseRouter.post('/:videoId/abuse', 42abuseRouter.post('/',
43 authenticate, 43 authenticate,
44 asyncMiddleware(abuseReportValidator), 44 asyncMiddleware(abuseReportValidator),
45 asyncRetryTransactionMiddleware(reportAbuse) 45 asyncRetryTransactionMiddleware(reportAbuse)
46) 46)
47abuseRouter.delete('/:videoId/abuse/:id', 47abuseRouter.delete('/:id',
48 authenticate, 48 authenticate,
49 ensureUserHasRight(UserRight.MANAGE_ABUSES), 49 ensureUserHasRight(UserRight.MANAGE_ABUSES),
50 asyncMiddleware(abuseGetValidator), 50 asyncMiddleware(abuseGetValidator),
@@ -74,7 +74,7 @@ async function listAbuses (req: express.Request, res: express.Response) {
74 count: req.query.count, 74 count: req.query.count,
75 sort: req.query.sort, 75 sort: req.query.sort,
76 id: req.query.id, 76 id: req.query.id,
77 filter: 'video', 77 filter: req.query.filter,
78 predefinedReason: req.query.predefinedReason, 78 predefinedReason: req.query.predefinedReason,
79 search: req.query.search, 79 search: req.query.search,
80 state: req.query.state, 80 state: req.query.state,