Fix deleting a video with comments

pull/292/head
Chocobozzz 2018-02-13 13:35:10 +01:00
parent d6bd50ba1d
commit 29c6b82944
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 21 additions and 0 deletions

View File

@ -188,6 +188,27 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
}) as AccountModel
}
if (!instance.Video) {
instance.Video = await instance.$get('Video', {
include: [
{
model: VideoChannelModel,
include: [
{
model: AccountModel,
include: [
{
model: ActorModel
}
]
}
]
}
],
transaction: options.transaction
}) as VideoModel
}
if (instance.isOwned()) {
await sendDeleteVideoComment(instance, options.transaction)
}