-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'
authenticate,
blacklistSortValidator,
ensureUserHasRight,
+ openapiOperationDoc,
paginationValidator,
setBlacklistSort,
setDefaultPagination,
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),
)
blacklistRouter.get('/blacklist',
+ openapiOperationDoc({ operationId: 'getVideoBlocks' }),
authenticate,
ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST),
paginationValidator,
)
blacklistRouter.delete('/:videoId/blacklist',
+ openapiOperationDoc({ operationId: 'delVideoBlock' }),
authenticate,
ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST),
asyncMiddleware(videosBlacklistRemoveValidator),