diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-04-20 11:20:12 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-01 16:41:02 +0200 |
commit | 0251197e249cc03b65805ed6805da72bf4573529 (patch) | |
tree | 3aae202fd1ea24bac5cd7f2c380ffe50aae189a0 /server/models/video/video.ts | |
parent | b8cf27c0f86d205a279d03b83e0e6728f46da67f (diff) | |
download | PeerTube-0251197e249cc03b65805ed6805da72bf4573529.tar.gz PeerTube-0251197e249cc03b65805ed6805da72bf4573529.tar.zst PeerTube-0251197e249cc03b65805ed6805da72bf4573529.zip |
Factorize rest-table and fix/simplify SQL
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index f32216e90..ccb9d64ca 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -813,10 +813,8 @@ export class VideoModel extends Model<VideoModel> { | |||
813 | const details = instance.toFormattedDetailsJSON() | 813 | const details = instance.toFormattedDetailsJSON() |
814 | 814 | ||
815 | for (const abuse of instance.VideoAbuses) { | 815 | for (const abuse of instance.VideoAbuses) { |
816 | tasks.push((_ => { | 816 | abuse.deletedVideo = details |
817 | abuse.deletedVideo = details | 817 | tasks.push(abuse.save({ transaction: options.transaction })) |
818 | return abuse.save({ transaction: options.transaction }) | ||
819 | })()) | ||
820 | } | 818 | } |
821 | 819 | ||
822 | Promise.all(tasks) | 820 | Promise.all(tasks) |