]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos/blacklist.ts
Put private videos under a specific subdirectory
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos / blacklist.ts
index ca2b85ea5bb5a8aa0e3eef24ac247f5fad7a2ecf..4103bb0630793b7f5edf3c521f46c821b004cb22 100644 (file)
@@ -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),