X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fvideos%2Fblacklist.ts;h=4103bb0630793b7f5edf3c521f46c821b004cb22;hb=3545e72c686ff1725bbdfd8d16d693e2f4aa75a3;hp=ca2b85ea5bb5a8aa0e3eef24ac247f5fad7a2ecf;hpb=76148b27f7501bac061992136852be4303370c8d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index ca2b85ea5..4103bb063 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts @@ -1,6 +1,6 @@ -import * as express from 'express' +import express from 'express' import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' -import { UserRight, VideoBlacklistCreate } from '../../../../shared' +import { HttpStatusCode, UserRight, VideoBlacklistCreate } from '@shared/models' import { logger } from '../../../helpers/logger' import { getFormattedObjects } from '../../../helpers/utils' import { sequelizeTypescript } from '../../../initializers/database' @@ -9,6 +9,7 @@ import { authenticate, blacklistSortValidator, ensureUserHasRight, + openapiOperationDoc, paginationValidator, setBlacklistSort, setDefaultPagination, @@ -18,11 +19,11 @@ import { videosBlacklistUpdateValidator } from '../../../middlewares' import { VideoBlacklistModel } from '../../../models/video/video-blacklist' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const blacklistRouter = express.Router() blacklistRouter.post('/:videoId/blacklist', + openapiOperationDoc({ operationId: 'addVideoBlock' }), authenticate, ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), asyncMiddleware(videosBlacklistAddValidator), @@ -30,6 +31,7 @@ blacklistRouter.post('/:videoId/blacklist', ) blacklistRouter.get('/blacklist', + openapiOperationDoc({ operationId: 'getVideoBlocks' }), authenticate, ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), paginationValidator, @@ -48,6 +50,7 @@ blacklistRouter.put('/:videoId/blacklist', ) blacklistRouter.delete('/:videoId/blacklist', + openapiOperationDoc({ operationId: 'delVideoBlock' }), authenticate, ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST), asyncMiddleware(videosBlacklistRemoveValidator),