diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-03 09:43:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-06 11:19:16 +0200 |
commit | 516df59b3bbb0218afeda595ee4966800bff4519 (patch) | |
tree | 4687691eeb0bf9c2846b673253c54628409345d1 /server/controllers/api/videos | |
parent | d7f83948a1af0ef3bed61f83e87e826902c96f7d (diff) | |
download | PeerTube-516df59b3bbb0218afeda595ee4966800bff4519.tar.gz PeerTube-516df59b3bbb0218afeda595ee4966800bff4519.tar.zst PeerTube-516df59b3bbb0218afeda595ee4966800bff4519.zip |
Remove ability to delete video imports
Users should remove the linked video instead
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/import.ts | 21 |
1 files changed, 1 insertions, 20 deletions
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 { | |||
4 | asyncMiddleware, | 4 | asyncMiddleware, |
5 | asyncRetryTransactionMiddleware, | 5 | asyncRetryTransactionMiddleware, |
6 | authenticate, | 6 | authenticate, |
7 | videoImportAddValidator, | 7 | videoImportAddValidator |
8 | videoImportDeleteValidator | ||
9 | } from '../../../middlewares' | 8 | } from '../../../middlewares' |
10 | import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers' | 9 | import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers' |
11 | import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl' | 10 | import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl' |
@@ -39,12 +38,6 @@ videoImportsRouter.post('/imports', | |||
39 | asyncRetryTransactionMiddleware(addVideoImport) | 38 | asyncRetryTransactionMiddleware(addVideoImport) |
40 | ) | 39 | ) |
41 | 40 | ||
42 | videoImportsRouter.delete('/imports/:id', | ||
43 | authenticate, | ||
44 | asyncMiddleware(videoImportDeleteValidator), | ||
45 | asyncRetryTransactionMiddleware(deleteVideoImport) | ||
46 | ) | ||
47 | |||
48 | // --------------------------------------------------------------------------- | 41 | // --------------------------------------------------------------------------- |
49 | 42 | ||
50 | export { | 43 | export { |
@@ -145,15 +138,3 @@ async function addVideoImport (req: express.Request, res: express.Response) { | |||
145 | 138 | ||
146 | return res.json(videoImport.toFormattedJSON()) | 139 | return res.json(videoImport.toFormattedJSON()) |
147 | } | 140 | } |
148 | |||
149 | async function deleteVideoImport (req: express.Request, res: express.Response) { | ||
150 | await sequelizeTypescript.transaction(async t => { | ||
151 | const videoImport = res.locals.videoImport | ||
152 | const video = videoImport.Video | ||
153 | |||
154 | await videoImport.destroy({ transaction: t }) | ||
155 | await video.destroy({ transaction: t }) | ||
156 | }) | ||
157 | |||
158 | return res.status(204).end() | ||
159 | } | ||