From 516df59b3bbb0218afeda595ee4966800bff4519 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Aug 2018 09:43:00 +0200 Subject: Remove ability to delete video imports Users should remove the linked video instead --- server/controllers/api/videos/import.ts | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'server/controllers/api/videos/import.ts') diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 680d8665f..ca7a5f9ca 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -4,8 +4,7 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, - videoImportAddValidator, - videoImportDeleteValidator + videoImportAddValidator } from '../../../middlewares' import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers' import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl' @@ -39,12 +38,6 @@ videoImportsRouter.post('/imports', asyncRetryTransactionMiddleware(addVideoImport) ) -videoImportsRouter.delete('/imports/:id', - authenticate, - asyncMiddleware(videoImportDeleteValidator), - asyncRetryTransactionMiddleware(deleteVideoImport) -) - // --------------------------------------------------------------------------- export { @@ -145,15 +138,3 @@ async function addVideoImport (req: express.Request, res: express.Response) { return res.json(videoImport.toFormattedJSON()) } - -async function deleteVideoImport (req: express.Request, res: express.Response) { - await sequelizeTypescript.transaction(async t => { - const videoImport = res.locals.videoImport - const video = videoImport.Video - - await videoImport.destroy({ transaction: t }) - await video.destroy({ transaction: t }) - }) - - return res.status(204).end() -} -- cgit v1.2.3