diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/import.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 9761cdbcf..680d8665f 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -41,7 +41,7 @@ videoImportsRouter.post('/imports', | |||
41 | 41 | ||
42 | videoImportsRouter.delete('/imports/:id', | 42 | videoImportsRouter.delete('/imports/:id', |
43 | authenticate, | 43 | authenticate, |
44 | videoImportDeleteValidator, | 44 | asyncMiddleware(videoImportDeleteValidator), |
45 | asyncRetryTransactionMiddleware(deleteVideoImport) | 45 | asyncRetryTransactionMiddleware(deleteVideoImport) |
46 | ) | 46 | ) |
47 | 47 | ||
@@ -147,5 +147,13 @@ async function addVideoImport (req: express.Request, res: express.Response) { | |||
147 | } | 147 | } |
148 | 148 | ||
149 | async function deleteVideoImport (req: express.Request, res: express.Response) { | 149 | async function deleteVideoImport (req: express.Request, res: express.Response) { |
150 | // TODO: delete video import | 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() | ||
151 | } | 159 | } |