]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video.ts
Factorize rest-table and fix/simplify SQL
[github/Chocobozzz/PeerTube.git] / server / models / video / video.ts
index f32216e908c4604d83fd7bc9d2f376bc1fb5bedb..ccb9d64ca4ad24a583429d58f75e23a5b647596e 100644 (file)
@@ -813,10 +813,8 @@ export class VideoModel extends Model<VideoModel> {
     const details = instance.toFormattedDetailsJSON()
 
     for (const abuse of instance.VideoAbuses) {
-      tasks.push((_ => {
-        abuse.deletedVideo = details
-        return abuse.save({ transaction: options.transaction })
-      })())
+      abuse.deletedVideo = details
+      tasks.push(abuse.save({ transaction: options.transaction }))
     }
 
     Promise.all(tasks)