From 57f6896f67cfc570cf3605dd94b0778101b2d9b9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 7 Jul 2020 10:57:04 +0200 Subject: Implement abuses check params --- server/controllers/api/abuse.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/controllers') 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' const abuseRouter = express.Router() -abuseRouter.get('/abuse', +abuseRouter.get('/', authenticate, ensureUserHasRight(UserRight.MANAGE_ABUSES), paginationValidator, @@ -33,18 +33,18 @@ abuseRouter.get('/abuse', abuseListValidator, asyncMiddleware(listAbuses) ) -abuseRouter.put('/:videoId/abuse/:id', +abuseRouter.put('/:id', authenticate, ensureUserHasRight(UserRight.MANAGE_ABUSES), asyncMiddleware(abuseUpdateValidator), asyncRetryTransactionMiddleware(updateAbuse) ) -abuseRouter.post('/:videoId/abuse', +abuseRouter.post('/', authenticate, asyncMiddleware(abuseReportValidator), asyncRetryTransactionMiddleware(reportAbuse) ) -abuseRouter.delete('/:videoId/abuse/:id', +abuseRouter.delete('/:id', authenticate, ensureUserHasRight(UserRight.MANAGE_ABUSES), asyncMiddleware(abuseGetValidator), @@ -74,7 +74,7 @@ async function listAbuses (req: express.Request, res: express.Response) { count: req.query.count, sort: req.query.sort, id: req.query.id, - filter: 'video', + filter: req.query.filter, predefinedReason: req.query.predefinedReason, search: req.query.search, state: req.query.state, -- cgit v1.2.3